Skip to content

Instantly share code, notes, and snippets.

@thomasxd24
Last active May 29, 2020 09: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 thomasxd24/bbb138962263013f2d9729f0dc35ef4c to your computer and use it in GitHub Desktop.
Save thomasxd24/bbb138962263013f2d9729f0dc35ef4c to your computer and use it in GitHub Desktop.
Traefik Stack yml
version: "3.3"
networks:
traefik:
external: true
services:
traefik:
image: "traefik:v2.2"
networks:
- traefik
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
version: "3.3"
networks:
traefik:
external: true
services:
whoami:
image: "containous/whoami"
networks:
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.thomasxd24.com`)"
- "traefik.http.routers.whoami.entrypoints=web"
version: "3.3"
services:
traefik:
image: traefik:v2.2
restart: always
ports:
- "80:80"
- "8080:8080" # traefik dashboard
- "443:443"
command:
- --api=true
- --api.insecure=true # set to 'false' on production
- --api.dashboard=true # see https://docs.traefik.io/v2.0/operations/dashboard/#secure-mode for how to secure the dashboard
- --api.debug=true # enable additional endpoints for debugging and profiling
- --log.level=DEBUG # debug while we get it working, for more levels/info see https://docs.traefik.io/observability/logs/
- --accesslog=true
- --log.filePath=/var/traefik/traefik.log
- --providers.docker=true
- --providers.docker.endpoint=tcp://127.0.0.1:2375
- --providers.docker.swarmMode=true
- --providers.docker.exposedbydefault=false
- --providers.docker.network=proxy
- --entrypoints.web.address=:80
- --entrypoints.web-secured.address=:443
- --certificatesresolvers.mytlschallenge.acme.httpChallenge.entrypoint=web
- --certificatesresolvers.mytlschallenge.acme.email=contact@pangolin.network
- --certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json
volumes:
- letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
networks:
- proxy
deploy:
placement:
constraints:
- node.role == manager
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`dashboard.srv2.pangolin.network`)"
- "traefik.http.routers.api.service=api@internal" # Let the dashboard access the traefik api
networks:
proxy:
external: true
volumes:
letsencrypt:
version: "3.3"
services:
whoami:
image: "containous/whoami"
networks:
- proxy
deploy:
labels:
- traefik.enable=true
- traefik.http.routers.whoami.rule=Host(`whoami.thomasxd24.com`)
- traefik.port=80
networks:
proxy:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment