When I deploy my Docker container, which I'm having issues with, using labels, everything works as it should. But when I now wish to switch it from using labels to dynamic configuration, it doesn't work. I get a 404 error. I have other Docker containers running, and I can point to them from the dynamic configuration without any problems.
My Docker Compose file with labels looks like this:
services:
ocis:
image: owncloud/ocis:latest
container_name: ocis
restart: unless-stopped
volumes:
- ocis-config:/etc/ocis
- ocis-data:/var/lib/ocis
...
networks:
- traefik-proxy
labels:
- "traefik.enable=true"
- "traefik.http.routers.ocis.rule=Host(`files.secret-filestorage.io`)"
- "traefik.http.routers.ocis.entrypoints=websecure"
- "traefik.http.routers.ocis.tls=true"
- "traefik.http.services.ocis.loadbalancer.server.port=9200"
- "traefik.http.routers.ocis.service=ocis"
My Docker Compose file without configuration labels looks like this:
networks:
- traefik-proxy
labels:
- "traefik.enable=true"
My dynamic configuration, when I run without labels, looks like this:
http:
routers:
ocis:
entryPoints: websecure
rule: Host (`files.secret-filestorage.io`)
service: ocis-service
tls: {}
services:
ocis-service:
loadBalancer:
servers:
- url: http://ocis
I deliberately omitted irrelevant configuration since nothing else has changed except for moving the configuration.
Looking at the Traefik Dashboard for the service created, the dynamically created service points to the correct IP address and port for the Docker container.
What am I missing, I wonder?
Thanks in advance!