Skip to content

Instantly share code, notes, and snippets.

@trajano
Created March 21, 2019 20:59
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 trajano/34aaa6746c836975d6351b80e40deb71 to your computer and use it in GitHub Desktop.
Save trajano/34aaa6746c836975d6351b80e40deb71 to your computer and use it in GitHub Desktop.
traefik compose file
version: "3.7"
services:
traefik:
image: traefik:v1.7.9-alpine
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
command:
- --defaultEntryPoints=http,https
- --insecureSkipVerify
- "--entryPoints=Name:http Address::80 Compress:true Redirect.entryPoint:https"
- "--entryPoints=Name:https Address::443 Compress:true TLS"
- --ping
- --docker
- --docker.endpoint=tcp://daemon:2375
- --docker.exposedByDefault=false
- --docker.swarmMode
- --docker.watch
- --acme
- --acme.email=foo@example.com
- --acme.onhostrule
- --acme.acmelogging=true
- --acme.entrypoint=https
- --acme.httpchallenge
- --acme.httpchallenge.entrypoint=http
- --zookeeper.endpoint=zookeeper:2181
- --zookeeper.prefix=traefik
- --acme.storage=traefik/acme/acme.json
healthcheck:
test: wget -q --spider http://localhost:8080/ping
networks:
- traefik
- internal
- default
deploy:
mode: global
resources:
limits:
memory: 64M
reservations:
memory: 16M
dashboard:
image: alpine/socat
command: tcp-listen:8080,fork TCP:httpbin.org:80
networks:
- traefik
deploy:
labels:
- "traefik.frontend.rule=Host:beta.learningjungle.com"
- "traefik.frontend.entryPoints=https"
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.frontend.passHostHeader=true"
- "traefik.port=8080"
- "traefik.protocol=http"
daemon:
image: alpine/socat
command: tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- default
deploy:
placement:
constraints:
- node.role == manager
resources:
limits:
cpus: '0.5'
memory: 32M
zookeeper:
image: zookeeper:3.4.13
networks:
internal:
internal: true
attachable: false
traefik:
internal: true
attachable: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment