Skip to content

Instantly share code, notes, and snippets.

@zrod
Created October 6, 2018 22:35
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 zrod/4b07aebfc1275264cccb5be0686ef67f to your computer and use it in GitHub Desktop.
Save zrod/4b07aebfc1275264cccb5be0686ef67f to your computer and use it in GitHub Desktop.
version: '3'
services:
traefik:
image: 'traefik'
restart: 'always'
ports:
- '80:80'
- '8080:8080'
- '443:443'
networks:
- 'web'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- './config/certificates/:/conf/'
- './traefik.toml:/traefik.toml'
container_name: 'traefik'
website:
build: .
command: puma -C config/puma.rb
expose:
- '3000'
volumes:
- '.:/app'
networks:
- 'web'
- 'default'
env_file:
- '.env'
tty: true
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=web'
- 'traefik.backend=website'
- 'traefik.protocol=https'
- 'traefik.port=3000'
- 'traefik.frontend.rule=Host:myapp.local'
- 'traefik.frontend.entryPoints=http,https'
- 'traefik.frontend.passHostHeader=true'
networks:
web:
external: true
[api]
[api.statistics]
recentErrors = 10
logLevel = "DEBUG"
[traefikLog]
filePath = "conf/traefik.log"
format = "json"
[accessLog]
filePath = "conf/access.log"
format = "json"
defaultEntryPoints = ["http", "https"]
insecureSkipVerify = true
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
certFile = "conf/dev_cert.crt"
keyFile = "conf/dev_cert.key"
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "myapp.local"
watch = true
exposedByDefault = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment