A lightweight HTTP API service that provides a label-based service registry. Services define their metadata (name, URL, description) via Docker Compose labels, and DockInfo exposes them via a simple REST API.
- Label-based service registry - Services register themselves via Docker Compose labels
- Selective visibility - Only services with
dockinfo.enable=trueappear in listings - No runtime Docker info - Returns only label-based metadata, not container status/ports/etc.
- Simple REST API - Easy to query from other services or frontends
Add to your compose.yaml:
services:
dockinfo:
image: ghcr.io/royadler/dockinfo:latest
container_name: dockinfo
restart: always
ports:
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- PORT=8080
# Your services register themselves with labels
my-service:
image: my-image:latest
labels:
- "dockinfo.enable=true"
- "dockinfo.name=My Service"
- "dockinfo.service.url=https://myservice.royadler.de"
- "dockinfo.description=Description of my service"
another-service:
image: another-image:latest
labels:
- "dockinfo.enable=true"
- "dockinfo.name=Another Service"
- "dockinfo.service.url=https://another.royadler.de"
- "dockinfo.description=Another service description"Services must have the following labels to appear in the registry:
dockinfo.enable=true- Enables the service to appear in listings
dockinfo.nameordockinfo.service.name- Display name (defaults to container name if not set)dockinfo.service.urlordockinfo.url- Service URLdockinfo.description- Service description
services:
my-app:
image: my-app:latest
labels:
- "dockinfo.enable=true"
- "dockinfo.name=My Application"
- "dockinfo.service.url=https://myapp.royadler.de"
- "dockinfo.description=A web application for managing tasks"Health check endpoint.
Response:
{
"status": "healthy"
}List all enabled packages/services (only those with dockinfo.enable=true).
Example:
curl https://dockinfo.royadler.de/packagesResponse:
{
"count": 2,
"packages": [
{
"name": "My Service",
"url": "https://myservice.royadler.de",
"description": "Description of my service"
},
{
"name": "Another Service",
"url": "https://another.royadler.de",
"description": "Another service description"
}
]
}Get label-based information about a specific package/service.
Example:
curl https://dockinfo.royadler.de/package/my-serviceResponse:
{
"name": "My Service",
"url": "https://myservice.royadler.de",
"description": "Description of my service"
}Get label-based information via query parameter or X-Container-Name header.
Example:
curl "https://dockinfo.royadler.de/package?container=my-service"
# or
curl -H "X-Container-Name: my-service" https://dockinfo.royadler.de/packageFind packages by label filter (returns label-based info only).
Example:
curl "https://dockinfo.royadler.de/by-label?label=dockinfo.enable=true"Response:
{
"filter": "dockinfo.enable=true",
"count": 2,
"packages": [
{
"name": "My Service",
"url": "https://myservice.royadler.de",
"description": "Description of my service"
}
]
}Get label-based information about the dockinfo container itself.
Get label-based information about the calling container.
Example:
curl -H "X-Container-Name: my-service" https://dockinfo.royadler.de/my-info
# or
curl "https://dockinfo.royadler.de/my-info?container=my-service"Other services can query DockInfo to discover registered services:
# List all enabled packages
curl https://dockinfo.royadler.de/packages
# Get info about a specific package
curl https://dockinfo.royadler.de/package/my-service
# Find packages by label
curl "https://dockinfo.royadler.de/by-label?label=dockinfo.enable=true"import requests
# Get all registered packages
response = requests.get('https://dockinfo.royadler.de/packages')
packages = response.json()
for package in packages['packages']:
print(f"{package['name']}: {package['url']}")
print(f" {package['description']}")// Fetch all registered services
fetch('https://dockinfo.royadler.de/packages')
.then(res => res.json())
.then(data => {
data.packages.forEach(pkg => {
console.log(`${pkg.name}: ${pkg.url}`);
});
});PORT- Port to listen on (default: 8080)HOST- Host to bind to (default: 0.0.0.0)CORS_ORIGINS- Comma-separated list of allowed CORS origins (default:https://royadler.de)- Supports wildcard patterns like
*.royadler.deto allow all subdomains - Example:
CORS_ORIGINS=https://royadler.de,https://*.royadler.de - Example:
CORS_ORIGINS=https://royadler.de,https://app.royadler.de,http://localhost:3000
- Supports wildcard patterns like
DOCKER_HOST- Docker daemon URL (default: auto-detect, e.g.,unix:///var/run/docker.sock)DOCKER_SOCKET- Custom Docker socket path inside container (default:/var/run/docker.sock)
- Label-based only: DockInfo reads only from Docker labels, not runtime container status
- Selective registration: Only services with
dockinfo.enable=trueappear in listings - No runtime info: The API does not return container status, ports, or other runtime Docker information
- Production ready: Uses gunicorn WSGI server, not Flask's development server