Skip to content

Instantly share code, notes, and snippets.

@rs-ds
Created July 4, 2020 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rs-ds/382240c4ce61b53e0a354a76bdd2bb50 to your computer and use it in GitHub Desktop.
Save rs-ds/382240c4ce61b53e0a354a76bdd2bb50 to your computer and use it in GitHub Desktop.
Traefik
version: '3'
volumes:
traefik_acme: {}
services:
traefik:
env_file: .env
build: traefik
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- traefik_acme:/etc/traefik/acme/ # Defined in traefik/traefik.toml
ports:
- 0.0.0.0:80:80
- 0.0.0.0:443:443
FROM traefik:alpine
RUN mkdir -p /etc/traefik/acme
RUN touch /etc/traefik/acme/acme.json
RUN chmod 600 /etc/traefik/acme/acme.json
COPY traefik.toml /etc/traefik
# Custom SSL Certificate
# COPY /path/to/ssl.crt /certs/ssl.crt
# COPY /path/to/ssl.key /certs/ssl.key
logLevel = "INFO"
defaultEntryPoints = ["https", "http"]
[retry]
[docker]
exposedByDefault = false
[Global]
debug = true
[log]
level = "DEBUG"
[accessLog]
# format = "json"
[api]
# entryPoint = "traefik"
# rule = "Host(`traefik.domain.com`)"
dashboard = false
[ping]
# Entrypoints, http and https
[entryPoints]
# http should be redirected to https
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
# https is the default
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
# Custom SSL certificate
# [[entryPoints.https.tls.certificates]]
# certFile = "/certs/ssl.crt"
# keyFile = "/certs/ssl.key"
[acme]
email = "dhilip@reckonsys.com"
storage = "/etc/traefik/acme/acme.json"
entryPoint = "https"
acmeLogging = true
onHostRule = true
# caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"
# Default: "https://acme-v02.api.letsencrypt.org/directory"
[acme.dnsChallenge]
provider = "route53"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment