Skip to content

Instantly share code, notes, and snippets.

@djmaze
Created January 17, 2018 22:58
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 djmaze/2684fbf147d775c8ee441b4302554823 to your computer and use it in GitHub Desktop.
Save djmaze/2684fbf147d775c8ee441b4302554823 to your computer and use it in GitHub Desktop.
Traefik loadbalancer running on Docker swarm (w/ Let's Encrypt)
version: "3.3"
services:
traefik:
image: traefik:1.5.0-rc5
command:
- --docker
- --docker.swarmmode
- --docker.watch
- --web
- --web.readonly
- --defaultEntrypoints=https
- --defaultEntrypoints=http
- --entryPoints=Name:http Address::80 Redirect.EntryPoint:https
- --entryPoints=Name:https Address::443 TLS
- --acme
- --acme.onhostrule
- --acme.entrypoint=https
- --acme.storage=/srv/traefik/acme.json
- --acme.httpChallenge.entryPoint=http
- --debug
volumes:
- data:/srv/traefik
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 80:80/tcp
- 443:443/tcp
networks:
- traefik
deploy:
placement:
constraints:
- node.labels.traefik == 1
- node.role == manager
volumes:
data:
networks:
traefik:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment