Created
April 16, 2019 15:17
-
-
Save dduportal/8ececf0c6826457c936004a2bcbb560a to your computer and use it in GitHub Desktop.
Traefik Path examples
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: '2.4' | |
services: | |
lb: | |
image: traefik:1.7.10 | |
command: | |
- "--docker.domain=localhost" | |
- "--api" | |
ports: | |
- "80:80" | |
- "8080:8080" | |
labels: | |
- "traefik.enable=false" | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
base: | |
image: containous/whoami | |
labels: | |
- "traefik.frontend.rule=PathPrefixStrip:/service" | |
admin: | |
image: containous/whoami | |
labels: | |
- "traefik.frontend.rule=PathPrefixStrip:/service/admin" | |
auth: | |
image: containous/whoami | |
labels: | |
- "traefik.frontend.rule=PathPrefixStrip:/service/auth" |
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
#!/bin/bash | |
set -eu | |
docker-compose up -d | |
# Wait | |
## Compare the container ids to see the differences | |
curl http://localhost/service | |
curl http://localhost/service/admin | |
curl http://localhost/service/auth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment