I’m trying to install traefik on my server using docker compose. I have this code in .yaml file
---
# -- (Optional) When using a custom network
networks:
frontend:
external: true
services:
traefik:
image: docker.io/library/traefik:v3.0.3
container_name: traefik
ports:
- 80:80
- 443:443
# -- (Optional) Enable Dashboard, don't do in production
# - 8080:8080
volumes:
- ./config:/etc/traefik
- /var/run/docker.sock:/var/run/docker.sock:ro
# -- (Optional) When using Cloudflare as Cert Resolver
environment:
- CF_DNS_API_TOKEN=SIstTuieaC0fhnatt4zcJ3ix7zKfMv3I0Ky1jpHo
# -- (Optional) When using a custom network
networks:
- frontend
restart: unless-stopped
But, everytime I’m trying to run it, docker start, container showes up in portainer GUI, but terminal end with code 0, and this error message
[+] Running 1/0
✔ Container traefik Recreated 0.0s
Attaching to traefik
traefik | {"level":"error","error":"command traefik error: read /etc/traefik/traefik.yaml: is a directory","time":"2024-07-02T19:05:23Z","message":"Command error"}
traefik exited with code 0
I have config file in same same cataloge where docker-compose.yaml file is, but i /config folder
I tried changing directories in file, but nothing worked
New contributor
Krystian Ignaczak is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.