Skip to content

Instantly share code, notes, and snippets.

@thanad
Created March 14, 2019 16:07
Show Gist options
  • Save thanad/4c690828759d7b7029dcd8e195c23c7c to your computer and use it in GitHub Desktop.
Save thanad/4c690828759d7b7029dcd8e195c23c7c to your computer and use it in GitHub Desktop.
traefik docker swarm
version: "3.3"
services:
traefik:
image: traefik
command: --web --docker --docker.swarmmode --docker.watch --logLevel=DEBUG
ports:
- "80:80"
- "8080:8080"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
replicas: 1
placement:
constraints: [node.role==manager]
restart_policy:
condition: on-failure
web:
image: emilevauge/whoami
deploy:
replicas: 3
labels:
- "traefik.port=80"
- "traefik.frontend.rule=Host:hello.docker.localhost"
visualizer:
image: dockersamples/visualizer:stable
ports:
- "8081:8080"
stop_grace_period: 1m30s
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
placement:
constraints: [node.role==manager]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment