Fix Traefik SSL certificate issues

- Fixed volume mount syntax for Swarm (use long-form bind mount syntax)
- Fixed Portainer TLS label syntax (tls.certresolver instead of tls.certificatesResolvers)
- These changes resolve SSL errors and certificate mounting issues

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-10 11:32:49 +00:00
parent 3871e30abd
commit ea7a373bc4
2 changed files with 17 additions and 5 deletions

View File

@@ -14,9 +14,11 @@ services:
labels:
- "traefik.enable=true"
- "traefik.swarm.network=homelab"
# Public-facing domain with Let's Encrypt certificate
- "traefik.http.routers.portainer.rule=Host(`portainer.frostlabs.me`)"
- "traefik.http.routers.portainer.entrypoints=websecure"
- "traefik.http.routers.portainer.tls.certificatesResolvers=cloudflare"
- "traefik.http.routers.portainer.tls=true"
- "traefik.http.routers.portainer.tls.certresolver=cloudflare"
- "traefik.http.services.portainer.loadbalancer.server.port=9000"
agent:

View File

@@ -9,10 +9,20 @@ services:
environment:
- CF_DNS_API_TOKEN_FILE=/run/secrets/cloudflare_api_token
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /home/doc/projects/swarm/conf/traefik-conf/static.yml:/etc/traefik/traefik.yml:ro
- /home/doc/projects/swarm/conf/traefik-conf/dynamic.yml:/etc/traefik/dynamic/dynamic.yml:rw
- /home/doc/projects/swarm-data/appdata/traefik/certificates:/certificates
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
read_only: true
- type: bind
source: /home/doc/projects/swarm/conf/traefik-conf/static.yml
target: /etc/traefik/traefik.yml
read_only: true
- type: bind
source: /home/doc/projects/swarm/conf/traefik-conf/dynamic.yml
target: /etc/traefik/dynamic/dynamic.yml
- type: bind
source: /home/doc/projects/swarm-data/appdata/traefik/certificates
target: /certificates
secrets:
- cloudflare_api_token
networks: