Created
March 26, 2018 19:06
-
-
Save q7r/514cc2feecc95986a081c064b901f2cc to your computer and use it in GitHub Desktop.
traefik-swarm-example
This file contains hidden or 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.3' | |
services: | |
traefik: | |
image: traefik:1.5 | |
command: -c --docker --docker.swarmmode --docker.domain=concept.ubox.one --docker.watch --web --acme --web.statistics --acme.storage=/etc/traefik/acme/acme.json --acme.email=DELETED --acme.dnsChallenge --acme.dnschallenge.provider=cloudflare --acme.entryPoint=https --entryPoints='Name:http Address::80 Compress:on' --entryPoints='Name:https Address::443 TLS Compress:on' --defaultentrypoints=http,https --accessLog --acme.domains="concept.ubox.one" | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- acme:/etc/traefik/acme | |
networks: | |
- appnet | |
environment: | |
CLOUDFLARE_API_KEY: DELETED | |
CLOUDFLARE_EMAIL: DELETED | |
ports: | |
- 80:80 | |
- 443:443 | |
- 8080:8080 | |
deploy: | |
placement: | |
constraints: [node.role == manager] | |
replicas: 1 | |
nginx-test: | |
image: nginx:alpine | |
networks: | |
- appnet | |
deploy: | |
replicas: 2 | |
labels: | |
- traefik.port=80 | |
- traefik.frontend.passHostHeader=true | |
- traefik.frontend.rule=Host:concept.ubox.one | |
- traefik.frontend.headers.SSLRedirect=true | |
apache-test: | |
image: httpd | |
networks: | |
- appnet | |
deploy: | |
replicas: 2 | |
labels: | |
- traefik.port=80 | |
- traefik.frontend.passHostHeader=true | |
- traefik.frontend.rule=Host:insecure.concept.ubox.one | |
networks: | |
appnet: | |
external: true | |
volumes: | |
acme: | |
driver: local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment