Skip to content

Instantly share code, notes, and snippets.

@recoder
Created January 2, 2018 16:14
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 recoder/513466e8d5886aaa8d67d774b063e855 to your computer and use it in GitHub Desktop.
Save recoder/513466e8d5886aaa8d67d774b063e855 to your computer and use it in GitHub Desktop.
Sample docker-compose config for traefik with LetsEncrypt and two domains plus dashboard
version: '2'
networks:
shout:
external:
name: web
whisper: {}
services:
traefik:
image: traefik
container_name: traefik
command:
- --defaultEntryPoints=https,http
- --entryPoints=Name:http Address::80 Redirect.EntryPoint:https
- --entryPoints=Name:https Address::443 TLS
- --acme=true
- --acme.email=recoder@gmail.com
- --acme.entryPoint=https
- --acme.onHostRule=true
# - --acme.onDemand=true
# - --acmeLogging=true
- --acme.storage=/certs/acme.json
- --web
- --web.address=:8080
- --docker
- --docker.domain=recoder.andrewz.org
- --docker.watch
- --logLevel=DEBUG
- --accessLogsFile='log/access.log'
networks: [ shout, whisper ]
ports:
- 80:80
- 443:443
- 8000:8000
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /dev/null:/traefik.toml
- ./acme.json:/certs/acme.json
labels:
- "traefik.frontend.rule=Host:recoder.andrewz.org"
- "traefik.enable=true"
- "traefik.port=8080"
whoami1:
image: jwilder/whoami
networks: [ whisper ]
labels:
- "traefik.backend=whoami1"
- "traefik.frontend.rule=Host:recoder.rocks"
- "traefik.enable=true"
- "traefik.port=8000"
whoami2:
image: jwilder/whoami
networks: [ whisper ]
labels:
- "traefik.backend=whoami2"
- "traefik.frontend.rule=Host:yes.recoder.rocks"
- "traefik.enable=true"
- "traefik.port=8000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment