Created
January 14, 2020 12:32
-
-
Save miyu4u/2d988dbce74eee7e2f0ecaccf25d4900 to your computer and use it in GitHub Desktop.
deploy traefik at all worker node with docker swarm
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.6" | |
services: | |
socket-proxy: | |
image: tecnativa/docker-socket-proxy | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
environment: | |
SERVICES: 1 | |
TASKS: 1 | |
NETWORKS: 1 | |
networks: | |
- mgmt | |
deploy: | |
placement: | |
constraints: | |
- node.role == manager | |
traefik: | |
image: traefik:v1.7 | |
command: | |
- "--docker" | |
- "--docker.endpoint=tcp://socket-proxy:2375" | |
- "--docker.watch" | |
- "--docker.swarmMode" | |
- "--api" | |
ports: | |
- 80:80 | |
- 443:443 | |
- 8080:8080 | |
networks: | |
- mgmt | |
- entry | |
deploy: | |
mode: global | |
placement: | |
constraints: | |
- node.role == worker | |
networks: | |
mgmt: | |
driver: overlay | |
entry: | |
driver: overlay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment