Created
November 1, 2017 19:07
-
-
Save mlabouardy/638c382e8996a81015e3839b224af4bf to your computer and use it in GitHub Desktop.
Traefik example with Swarm mode
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.3" | |
services: | |
traefik: | |
image: traefik:1.4 | |
ports: | |
- 80:80 | |
- 8080:8080 | |
networks: | |
- traefik-net | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
configs: | |
- source: traefik-config | |
target: /etc/traefik/traefik.toml | |
deploy: | |
placement: | |
constraints: | |
- node.role == manager | |
books: | |
image: mlabouardy/books-api | |
networks: | |
- traefik-net | |
deploy: | |
placement: | |
constraints: | |
- node.role == worker | |
labels: | |
- "traefik.port=5000" | |
- "traefik.backend=books" | |
- "traefik.frontend.rule=Path:/books" | |
movies: | |
image: mlabouardy/movies-api | |
networks: | |
- traefik-net | |
deploy: | |
placement: | |
constraints: | |
- node.role == worker | |
labels: | |
- "traefik.port=5000" | |
- "traefik.backend=movies" | |
- "traefik.frontend.rule=Path:/movies" | |
networks: | |
traefik-net: | |
driver: overlay | |
configs: | |
traefik-config: | |
file: config.toml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment