Skip to content

Instantly share code, notes, and snippets.

@MichalKalita
Created July 19, 2018 15:27
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 MichalKalita/3b27226bd2d0f07956fd1d70cd00ec77 to your computer and use it in GitHub Desktop.
Save MichalKalita/3b27226bd2d0f07956fd1d70cd00ec77 to your computer and use it in GitHub Desktop.
Traefik docker basic configuration
version: '2'
services:
traefik:
image: traefik:latest
restart: always
ports:
- 80:80
- 443:443
- 8080:8080
networks:
- traefik
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/traefik/traefik.toml:/traefik.toml
- /opt/traefik/acme.json:/acme.json
container_name: traefik
networks:
traefik:
external: true
debug = false
logLevel = "INFO"
defaultEntryPoints = ["https","http"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[retry]
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "example.com"
watch = true
exposedByDefault = false
[acme]
email = "email@example.com"
storage = "acme.json"
entryPoint = "https"
OnHostRule = true
[acme.httpChallenge]
entryPoint = "http"
[api]
dashboard = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment