Created
June 27, 2021 16:51
-
-
Save marcelmaatkamp/eb1b549d805788b6792f23dbd3ca3e52 to your computer and use it in GitHub Desktop.
traefik dashboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
reverse-proxy: | |
image: traefik:v2.3.4 | |
command: | |
# Docker swarm configuration | |
- "--providers.docker.endpoint=unix:///var/run/docker.sock" | |
- "--providers.docker.swarmMode=true" | |
- "--providers.docker.exposedbydefault=false" | |
- "--providers.docker.network=traefik-public" | |
# Configure entrypoint | |
- "--entrypoints.web.address=:80" | |
- "--entrypoints.websecure.address=:443" | |
# SSL configuration | |
- "--certificatesresolvers.letsencryptresolver.acme.httpchallenge=true" | |
- "--certificatesresolvers.letsencryptresolver.acme.httpchallenge.entrypoint=web" | |
- "--certificatesresolvers.letsencryptresolver.acme.email=user@domaine.com" | |
- "--certificatesresolvers.letsencryptresolver.acme.storage=/letsencrypt/acme.json" | |
# Global HTTP -> HTTPS | |
- "--entrypoints.web.http.redirections.entryPoint.to=websecure" | |
- "--entrypoints.web.http.redirections.entryPoint.scheme=https" | |
# Enable dashboard | |
- "--api.dashboard=true" | |
ports: | |
- 80:80 | |
- 443:443 | |
volumes: | |
- traefik-certificates:/letsencrypt | |
- /var/run/docker.sock:/var/run/docker.sock:ro | |
networks: | |
- traefik-public | |
deploy: | |
placement: | |
constraints: | |
- node.role == manager | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.services.traefik.loadbalancer.server.port=888" # required by swarm but not used. | |
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)" | |
- "traefik.http.routers.http-catchall.entrypoints=web" | |
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https@docker" | |
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" | |
volumes: | |
traefik-certificates: | |
networks: | |
traefik-public: | |
external: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment