Skip to content

Instantly share code, notes, and snippets.

@ernest-okot
Last active June 28, 2018 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ernest-okot/e458b5190fdb340c2caf812c11c25d5b to your computer and use it in GitHub Desktop.
Save ernest-okot/e458b5190fdb340c2caf812c11c25d5b to your computer and use it in GitHub Desktop.
Traefik Docker Stack with HTTPS integration with LetsEncrypt
version: '3'
services:
traefik:
image: traefik:alpine
command: |-
--entryPoints="Name:http Address::80 Redirect.EntryPoint:https"
--entryPoints="Name:https Address::443 TLS"
--defaultentrypoints="http,https"
--accesslogsfile="/var/log/access.log"
--acme
--acme.acmelogging="true"
# Change this to an actual email address
--acme.email="example@example.com"
--acme.entrypoint="https"
--acme.storage="/acme/acme.json"
--acme.onhostrule="true"
--docker
--docker.swarmmode
# Change this to your primary domain
--docker.domain="example.com"
--docker.watch
--web
ports:
- 80:80
- 443:443
- 8080:8080
networks:
- proxy
volumes:
- traefik_acme:/acme/
- traefik_logs:/var/log/access.log
- /var/run/docker.sock:/var/run/docker.sock
deploy:
placement:
constraints:
- node.role == manager
volumes:
traefik_acme:
traefik_logs:
# You'll need to create an network with the overlay driver
# ~$ docker network create --driver overlay proxy
networks:
proxy:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment