Skip to content

Instantly share code, notes, and snippets.

@thomas15v
Last active June 22, 2022 09:41
Show Gist options
  • Save thomas15v/a6fb66a479a5f2cec538c826e40036ae to your computer and use it in GitHub Desktop.
Save thomas15v/a6fb66a479a5f2cec538c826e40036ae to your computer and use it in GitHub Desktop.
traefik.io nginx example
version: '2'
services:
nginx:
image: nginx:alpine
restart: always
labels:
- "traefik.enable=true"
- 'traefik.frontend.rule=Host:www.website.com'
- "traefik.port=80"
volumes:
- ./website:/usr/share/nginx/html
proxy:
image: traefik
command: --web -c /etc/traefik/traefik.toml --LOGLEVEL=debug
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/etc/traefik/traefik.toml
- /acme
InsecureSkipVerify = true
defaultEntryPoints = ["https", "http"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
compress = true
[entryPoints.https.tls]
[acme]
email = "[email protected]"
storage = "/acme/acme.json"
entryPoint = "https"
OnHostRule = true
[acme.httpChallenge]
entryPoint = "http"
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "docker.localhost"
exposedbydefault = false
watch = true
@smokkapa
Copy link

smokkapa commented Mar 2, 2020

this works on traefik:v1.7.21 not on the latest version of the container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment