Skip to content

Instantly share code, notes, and snippets.

@undernewmanagement
Created September 15, 2019 08:47
Show Gist options
  • Save undernewmanagement/2f81ba9919b1b8ed061a59251ecf2453 to your computer and use it in GitHub Desktop.
Save undernewmanagement/2f81ba9919b1b8ed061a59251ecf2453 to your computer and use it in GitHub Desktop.
Awesome Traefik config for docker-compose and letsencrypt
version: '3'
services:
traefik:
image: traefik:1.7.9
restart: always
ports:
- 80:80
- 443:443
- 8080:8080
networks:
- web
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./acme.json:/acme.json
- ./logs:/logs
container_name: traefik
command:
- --debug=false
- --logLevel=INFO
- --defaultentrypoints=https,http
- --entryPoints=Name:http Address::80 Redirect.EntryPoint:https
- --entryPoints=Name:https Address::443 Compress:true TLS
- --retry
- --docker.endpoint=unix:///var/run/docker.sock
- --docker.domain=${DOCKER_DOMAIN}
- --docker.watch=true
- --docker.exposedbydefault=false
- --acme.email=${EMAIL}
- --acme.storage=acme.json
- --acme.entryPoint=https
- --acme.onHostRule=true
- --acme.httpchallenge.entrypoint=http
- --accesslog
- --accesslog.format=json
- --accesslog.filepath=logs/accesslog.json
- --traefiklog.filepath=logs/traefiklog.json
- --traefiklog.format=json
networks:
web:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment