Created
December 6, 2021 16:39
-
-
Save pyaillet/1a5d85e33a24efb2eb11f7456dc06206 to your computer and use it in GitHub Desktop.
traefik constraintes
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: | |
blue: | |
image: containous/whoami | |
labels: | |
- traefik.http.routers.blue.rule=PathPrefix("/") | |
- color=blue | |
proxy: | |
image: traefik:v2.5.4 | |
# Enables the web UI and tells Traefik to listen to docker | |
command: | |
- --providers.docker | |
- --providers.docker.constraints=Label(`color`,`blue`) | |
ports: | |
- "80:80" | |
volumes: | |
# So that Traefik can listen to the Docker events | |
- /var/run/docker.sock:/var/run/docker.sock |
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: | |
green: | |
image: containous/whoami | |
labels: | |
- traefik.http.routers.green.rule=PathPrefix("/") | |
- color=green | |
proxy: | |
image: traefik:v2.5.4 | |
# Enables the web UI and tells Traefik to listen to docker | |
command: | |
- --providers.docker | |
- --providers.docker.constraints=Label(`color`,`green`) | |
ports: | |
- "81:80" | |
volumes: | |
# So that Traefik can listen to the Docker events | |
- /var/run/docker.sock:/var/run/docker.sock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment