Files
agence66-traefik-docker/docker-compose.yml
BeauTroll 4e16685ebe Fix Traefik configuration issues and improve security
- Upgrade to traefik:latest to fix Docker API compatibility with v29
- Fix websecure entrypoint indentation in traefik.yml
- Remove obsolete DOCKER_API_VERSION environment variable
- Remove incompatible network_mode: host setting
- Set network to external for multi-compose compatibility
- Add environment variable support for certificate email
- Add acme.json to .gitignore for security
- Create acme.json with correct 600 permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 04:31:56 +01:00

28 lines
941 B
YAML

services:
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/etc/traefik/traefik.yml:ro
- ./acme.json:/acme.json
networks:
- traefik-net
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik-dashboard.rule=Host(`${DASHBOARD_HOST}`)"
- "traefik.http.routers.traefik-dashboard.entrypoints=websecure"
- "traefik.http.routers.traefik-dashboard.service=api@internal"
- "traefik.http.routers.traefik-dashboard.tls.certresolver=letsencrypt"
- "traefik.http.routers.traefik-dashboard.middlewares=traefik-auth"
- "traefik.http.middlewares.traefik-auth.basicauth.users=${DASHBOARD_USER}:${DASHBOARD_PASSWORD}"
networks:
traefik-net:
external: true