Skip to content

Instantly share code, notes, and snippets.

@grofit
Last active June 2, 2020 13:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grofit/e9a94ca02ba31ed1db9f88104f81c502 to your computer and use it in GitHub Desktop.
Save grofit/e9a94ca02ba31ed1db9f88104f81c502 to your computer and use it in GitHub Desktop.
Setting up traefik 2 dashboard manually - This was a huge time sink for me, I hope this helps you (see https://gist.github.com/grofit/34c68dfa836eb351815edede5fc71f2f for my one with basic auth)
version: "3.7"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
ports:
- "80:80"
- "443:443"
- "8080:8080" # could be any port you want 1234:8080
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/traefik.yml:/traefik.yml:ro" # Tell it to load our above file and use config in there
labels:
- "traefik.enable=true" # Manually enable the dashboard
- "traefik.http.routers.api.service=api@internal" # Tell the router to have a route called `api` that binds to the internal api
- "traefik.http.routers.api.entrypoints=api" # Tell the `api` route to use the `api` entrypoint from traefik file (port 8080)
- "traefik.http.routers.api.rule=Host(`localhost`)" # Tell the `api` route to only listen to requests for `localhost` (put whatever you want in here)
log:
level: INFO
api:
dashboard: true
# Notice there is NO insecure: true
entryPoints:
http:
address: ":80"
api: # This is needed to tell it to listen out on 8080
address: ":8080"
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
watch: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment