Skip to content

Instantly share code, notes, and snippets.

@metavige
Created December 19, 2022 13:34
Show Gist options
  • Save metavige/6949b2c259bdb01997c0bd53993b1ed3 to your computer and use it in GitHub Desktop.
Save metavige/6949b2c259bdb01997c0bd53993b1ed3 to your computer and use it in GitHub Desktop.
traefik sample - PathPrefix
services:
traefik:
privileged: true
image: 'traefik:2.9'
command:
- '--log.level=INFO'
- '--global.checkNewVersion=true'
- '--providers.docker=true'
- '--providers.docker.exposedbydefault=true'
- '--entrypoints.web.address=:80'
- '--api.insecure=true'
- '--api.dashboard=true'
- '--providers.docker.defaultrule=HostRegexp(`traefik.docker.internal`) && PathPrefix(`/{{ index .Labels "com.docker.compose.service" }}`)'
labels:
- 'traefik.http.routers.traefik.rule=HostRegexp(`traefik.docker.internal`)'
- 'traefik.http.routers.traefik.entrypoints=web'
- 'traefik.http.routers.traefik.service=api@internal'
ports:
- '80:80'
# - '443:443'
# - '8888:8080'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro'
- '/etc/localtime:/etc/localtime:ro'
whoami:
image: traefik/whoami
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment