Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marten-cz/665b95380e96c1c061358d7e9db092c9 to your computer and use it in GitHub Desktop.
Save marten-cz/665b95380e96c1c061358d7e9db092c9 to your computer and use it in GitHub Desktop.
Docker infrastructure - Traefik
version: '3.2'
services:
python:
image: python:3.6.5-alpine3.7
expose:
- 80
networks:
- internal
- traefik
labels:
- traefik.backend=app
- traefik.frontend.rule=Host:app.vcap.me # .vcap.me point always to localhost
- traefik.docker.network=traefik
- traefik.port=80
mysql:
image: mysql:5.7.20
expose:
- 3306
networks:
- internal
labels:
- traefik.enable=false
volumes:
mysql_data:
networks:
proxy:
external: true
traefik:
external: false
version: "2"
services:
traefik:
image: traefik:alpine
container_name: "traefik_proxy"
#command: --logLevel=DEBUG
ports:
- 80:80
- 443:443
- 8080:8080 # Dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
- ./acme.json:/acme.json
labels:
- 'traefik.frontend.rule=Host:monitor.vcap.me'
- 'traefik.port=8080'
networks:
- traefik
networks:
traefik:
external: true
defaultEntryPoints = ["http", "https"]
[entryPoints]
[entryPoints.http]
address = ":80"
# [entryPoints.http.redirect]
# entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[api]
entryPoint = "traefik"
dashboard = true
debug = true
address = ":8080"
[api.statistics]
recentErrors = 10
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "vcap.me"
watch = true
exposedbydefault = true
@marten-cz
Copy link
Author

You have to create empty acme.json file with 0600 permissions.

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