Last active
June 28, 2018 00:44
-
-
Save ernest-okot/e458b5190fdb340c2caf812c11c25d5b to your computer and use it in GitHub Desktop.
Traefik Docker Stack with HTTPS integration with LetsEncrypt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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