Created
May 29, 2018 08:29
-
-
Save marten-cz/665b95380e96c1c061358d7e9db092c9 to your computer and use it in GitHub Desktop.
Docker infrastructure - Traefik
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have to create empty
acme.json
file with 0600 permissions.