Skip to content

Instantly share code, notes, and snippets.

@danielnaranjo
Forked from thomas15v/docker.compose.yml
Created December 17, 2018 12:47
Show Gist options
  • Save danielnaranjo/d45e6606e422d3601972858fd2ad1be6 to your computer and use it in GitHub Desktop.
Save danielnaranjo/d45e6606e422d3601972858fd2ad1be6 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 = "your@email.com"
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment