Forked from containeroo-gists/traefik-wildcard-docker-compose.yml
Created
August 6, 2021 22:23
-
-
Save shawnhank/ee962de178aec96d22bd503cbc616b18 to your computer and use it in GitHub Desktop.
This file contains hidden or 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: | |
traefik: | |
image: traefik:v2.0 | |
container_name: traefik | |
restart: unless-stopped | |
security_opt: | |
- no-new-privileges:true | |
networks: | |
- proxy | |
ports: | |
- 80:80 | |
- 443:443 | |
environment: | |
- [email protected] | |
- CF_API_KEY=your-cloudflare-api-key | |
volumes: | |
- /etc/localtime:/etc/localtime:ro | |
- /var/run/docker.sock:/var/run/docker.sock:ro | |
- ./data/traefik.yml:/traefik.yml:ro | |
- ./data/acme.json:/acme.json | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.routers.traefik.entrypoints=http" | |
- "traefik.http.routers.traefik.rule=Host(`traefik.example.com`)" | |
- "traefik.http.middlewares.traefik-auth.basicauth.users=USER:PASSWORD" | |
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https" | |
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect" | |
- "traefik.http.routers.traefik-secure.entrypoints=https" | |
- "traefik.http.routers.traefik-secure.rule=Host(`traefik.example.com`)" | |
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth" | |
- "traefik.http.routers.traefik-secure.tls=true" | |
- "traefik.http.routers.traefik-secure.tls.certresolver=cloudflare" | |
- "traefik.http.routers.traefik-secure.tls.domains[0].main=example.com" | |
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.example.com" | |
- "traefik.http.routers.traefik-secure.service=api@internal" | |
networks: | |
proxy: | |
external: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment