I have the following Traefik setup:
- Docker network with multiple services. Right now I just wish traefik to forward/proxy all traefik/syncly request to the service fastapi.
Here's my docker-compose.yml
for Traefik:
traefik:
image: traefik:v3.3
container_name: syncly_traefik
ports:
- "80:80"
- "443:443"
- "8080:8080"
networks:
- syncly_network
volumes:
- ./traefik/traefik.toml:/etc/traefik/traefik.toml
- ./.logs:/var/log/traefik.log
- ./traefik/certs:/certs
And my traefik.toml
:
# traefik.toml
[api]
dashboard = true
insecure = true
[entryPoints]
[entryPoints.http]
address = ":80"
[log]
level = "DEBUG"
[accessLog]
addInternals = true
[http.routers]
[http.routers.fastapi]
service = "fastapi"
rule = "PathPrefix(`/syncly`)"
entryPoints = ["http"]
[http.routers.traefik]
rule = "PathPrefix(`/traefik`)"
service = "api@internal"
entryPoints = ["http"]
[http.services]
[http.services.fastapi.loadBalancer]
[[http.services.fastapi.loadBalancer.servers]]
url = "http://syncly_web:8000"
I can without problems reach syncly_web
from the traefik container:
However, entering localhost/syncly
leads me to nowhere.
In addition, the service is not availalbe in the dashboard:
It doesn't appear at Errors
tab either. The route also doesnt appear at HTTP Routers
, nor does the oen with PathPrefix('/traefik')