Skip to content

Instantly share code, notes, and snippets.

@miyu4u
Created January 14, 2020 12:32
Show Gist options
  • Save miyu4u/8f40bb7174994f8f310c0609bc8ef4c2 to your computer and use it in GitHub Desktop.
Save miyu4u/8f40bb7174994f8f310c0609bc8ef4c2 to your computer and use it in GitHub Desktop.
deploy traefik at all worker node with docker swarm
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