Following the docker-compose example in getting started:
Static config: traefik.toml
[api]
[entryPoints.traefik]
address = ":8080"
docker-compose.yml
reverse-proxy:
image: traefik:v2.2
ports:
# The HTTP port
- "80:80"
# The Web UI
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
# Make config present in the container
- ./traefik.toml:/etc/traefik/traefik.toml
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=PathPrefix(`/api`) || PathPrefix(`/dashboard`)"
- "traefik.http.routers.traefik.entrypoints=traefik"
- "traefik.http.routers.traefik.service=api@internal"