-
-
Save evaldobarbosa/dd121f6ec61f0cc580cc5f41305df987 to your computer and use it in GitHub Desktop.
Two stacks behind traefik https://docs.traefik.io/user-guide/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" | |
services: | |
web: | |
image: emilevauge/whoami | |
networks: | |
- default | |
- traefik-net | |
deploy: | |
labels: | |
- "traefik.port=80" | |
- "traefik.docker.network=traefik-net" | |
- "traefik.frontend.rule=Host:whoamistack1.traefik.local" | |
networks: | |
traefik-net: | |
external: true |
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" | |
services: | |
web: | |
image: emilevauge/whoami | |
networks: | |
- default | |
- traefik-net | |
deploy: | |
labels: | |
- "traefik.port=80" | |
- "traefik.docker.network=traefik-net" | |
- "traefik.frontend.rule=Host:whoamistack2.traefik.local" | |
networks: | |
traefik-net: | |
external: true |
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
$ docker network create --driver=overlay traefik-net | |
$ docker service create \ | |
--name traefik \ | |
--constraint=node.role==manager \ | |
--publish 80:80 --publish 8080:8080 \ | |
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \ | |
--network traefik-net \ | |
traefik \ | |
--docker \ | |
--docker.swarmMode \ | |
--docker.domain=traefik \ | |
--docker.watch \ | |
--api |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment