Skip to content

Instantly share code, notes, and snippets.

@swrogers
Created June 27, 2020 21:47
Show Gist options
  • Save swrogers/9989f0ceb8d4d6d87269d2b41729a6ab to your computer and use it in GitHub Desktop.
Save swrogers/9989f0ceb8d4d6d87269d2b41729a6ab to your computer and use it in GitHub Desktop.
My traefik docker-compose.yml start
version: '3'
services:
reverse-proxy:
image: traefik:v2.2
command:
- "--api.insecure=true"
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--certificatesresolvers.myresolver.acme.httpchallenge=true"
- "[email protected]"
- "--certificatesresolvers.myresolver.acme.storage=/acme.json"
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./acme.json:/acme.json
whoami:
image: "containous/whoami"
container_name: "simple-service"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.swrlab.org`)"
- "traefik.http.routers.whoami.entrypoints=websecure"
- "traefik.http.routers.whoami.tls.certresolver=myresolver"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment