Skip to content

Instantly share code, notes, and snippets.

@dduportal
Created April 16, 2019 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dduportal/8ececf0c6826457c936004a2bcbb560a to your computer and use it in GitHub Desktop.
Save dduportal/8ececf0c6826457c936004a2bcbb560a to your computer and use it in GitHub Desktop.
Traefik Path examples
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"
#!/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