Skip to content

Instantly share code, notes, and snippets.

@warlock
Last active December 20, 2022 13:27
Show Gist options
  • Save warlock/e8df1b37c681ca41020e8d4fd96066bd to your computer and use it in GitHub Desktop.
Save warlock/e8df1b37c681ca41020e8d4fd96066bd to your computer and use it in GitHub Desktop.
Traefik 2.3 Reverse Proxy in docker-compose
version: "3.3"
services:
traefik:
image: "traefik:v2.3"
container_name: "traefik"
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--metrics.prometheus"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
whoami:
image: "traefik/whoami"
container_name: "simple-service"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.localhost`)"
- "traefik.http.routers.whoami.entrypoints=web"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment