Here is my docker-compose.yml file to deploy traefik using docker swarm:
version: '3.3'
services:
traefik:
deploy:
placement:
constraints:
- node.labels.traefik == true
labels:
- traefik.enable=true
- traefik.http.middlewares.admin-auth.basicauth.users=admin:$$2y$$05$$password
- traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
- traefik.http.middlewares.https-redirect.redirectscheme.scheme.permanent=true
- traefik.http.routers.traefik-public-http.rule=Host('somedomain.com')
- traefik.http.routers.traefik-public-http.entrypoints=http
- traefik.http.routers.traefik-public-http.middlewares=https-redirect
- traefik.http.routers.traefik-public-https.rule=Host('somedomain.com')
- traefik.http.routers.traefik-public-https.entrypoints=https
- traefik.http.routers.traefik-public-https.tls=true
- traefik.http.routers.traefik-public-https.service=api@internal
- traefik.http.routers.traefik-public-https.tls.certresolver=le
- traefik.http.routers.traefik-public-https.middlewares=admin-auth
- traefik.http.services.traefik-public.loadbalancer.server.port=8080
image: traefik:v2.7
command:
- --log.level=DEBUG
- --providers.docker
- --providers.docker.exposedbydefault=false
- --providers.docker.swarmmode=true
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
- [email protected]
- --certificatesresolvers.le.acme.storage=/certificates/acme.json
- --certificatesresolvers.le.acme.tlschallenge=true
- --accesslog
- --api
- --log
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik-public-certificates:/certificates
networks:
- traefik-public
volumes:
traefik-public-certificates:
networks:
traefik-public:
external: true
After deploying it using docker stack deploy -c docker-compose.yml traefik
command i finally get a service with one container running, but docker service logs traefik_traefik
displays an error like:
traefik_traefik.1.d5yd2efpgxix@mgr | time="2024-12-27T12:19:54Z" level=error msg="invalid node scheme: string" providerName=docker container=traefik-traefik-d5yd2efpgxixmm3ok1otpebg
I can’t get rid of it. Network traefik-public is previously successfully created using docker network create -d overlay traefik-public
.
Please, could you advice me how to correct this error, or at least suggest the right direction.
I tried to remove all mentions of “container_name” or etc from compose.yml, unsuccessfully
evghenii is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.