Created
January 9, 2020 01:11
-
-
Save Taubin/083a1cb237cc7bee77833f58b1e014f2 to your computer and use it in GitHub Desktop.
Traefik
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.6" | |
services: | |
whoami: | |
image: "containous/whoami" | |
container_name: "whoami" | |
hostname: "whoami" | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.routers.wholami.entrypoints=websecure" | |
- "traefik.http.routers.wholami.rule=Host(`whoami.$MY_DOMAIN`)" | |
- "traefik.http.routers.wholami.tls.certresolver=lets-encr" | |
- "traefik.http.routers.wholami.tls=true" | |
- "traefik.frontend.headers.STSSeconds=315360000" | |
- "traefik.frontend.headers.browserXSSFilter=true" | |
- "traefik.frontend.headers.contentTypeNosniff=true" | |
- "traefik.frontend.headers.forceSTSHeader=true" | |
- "traefik.frontend.headers.SSLHost=dusty-home.com" | |
- "traefik.frontend.headers.STSIncludeSubdomains=true" | |
- "traefik.frontend.headers.STSPreload=true" | |
- "traefik.frontend.headers.customFrameOptionsValue: allow-from https:${DOMAINNAME}" | |
# - "traefik.frontend.auth.basic.users=${HTTP_USERNAME}:${HTTP_PASSWORD}" | |
traefik: | |
image: "traefik:v2.1" | |
container_name: "traefik" | |
hostname: "traefik" | |
restart: unless-stopped | |
env_file: | |
- .env | |
ports: | |
- "80:80" | |
- "443:443" | |
- "8080:8080" | |
volumes: | |
- "/var/run/docker.sock:/var/run/docker.sock:ro" | |
- "./traefik.yml:/traefik.yml:ro" | |
- "./acme.json:/acme.json" | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.routers.traefik.tls.certresolver=lets-encr" | |
- "traefik.http.routers.traefik.tls.domains[0].main=*.$MY_DOMAIN" | |
- "traefik.http.routers.traefik.tls.domains[0].sans=$MY_DOMAIN" | |
- "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" | |
- "traefik.http.routers.api.service=api@internal" | |
- "traefik.http.routers.tls=true" | |
- "traefik.frontend.headers.STSSeconds=315360000" | |
- "traefik.frontend.headers.browserXSSFilter=true" | |
- "traefik.frontend.headers.contentTypeNosniff=true" | |
- "traefik.frontend.headers.forceSTSHeader=true" | |
- "traefik.frontend.headers.SSLHost=dusty-home.com" | |
- "traefik.frontend.headers.STSIncludeSubdomains=true" | |
- "traefik.frontend.headers.STSPreload=true" | |
- "traefik.frontend.headers.customFrameOptionsValue: allow-from https:${DOMAINNAME}" | |
- "traefik.frontend.auth.basic.users=${HTTP_USERNAME}:${HTTP_PASSWORD}" | |
networks: | |
default: | |
external: | |
name: traefik_proxy | |
traefik_proxy: | |
external: | |
name: traefik_proxy |
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
## STATIC CONFIGURATION | |
log: | |
level: INFO | |
api: | |
# insecure: true | |
dashboard: true | |
entryPoints: | |
web: | |
address: ":80" | |
websecure: | |
address: ":443" | |
providers: | |
docker: | |
endpoint: "unix:///var/run/docker.sock" | |
exposedByDefault: false | |
certificatesResolvers: | |
lets-encr: | |
acme: | |
# caServer: https://acme-staging-v02.api.letsencrypt.org/directory | |
email: [REDACTED] | |
storage: acme.json | |
dnsChallenge: | |
provider: cloudflare | |
resolvers: | |
- "1.1.1.1:53" | |
- "8.8.8.8:53" | |
tls: | |
options: | |
default: | |
minVersion: VersionTLS12 | |
cipherSuites: | |
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | |
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 | |
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | |
- TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 | |
- TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 | |
sniStrict: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment