Created
April 28, 2019 20:48
-
-
Save Starttoaster/c15f316830ac3d9cd22c125c62cf648b to your computer and use it in GitHub Desktop.
Portainer + 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: "2" | |
services: | |
# Reverse Proxy and Let's Encrypt | |
traefik: | |
container_name: traefik | |
image: traefik:alpine | |
restart: always | |
networks: | |
- srv | |
ports: | |
- 80:80 | |
- 443:443 | |
volumes: | |
- /opt/traefik/traefik.toml:/traefik.toml | |
- /var/run/docker.sock:/var/run/docker.sock | |
- /opt/traefik/acme.json:/acme.json | |
# Portainer | |
portainer: | |
container_name: portainer | |
image: portainer/portainer | |
restart: always | |
networks: | |
- srv | |
ports: | |
- "9000:9000" | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- /opt/portainer:/data | |
labels: | |
- traefik.enable=true | |
- "traefik.frontend.rule=Host:port.MY-DOMAIN" | |
networks: | |
srv: |
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] | |
[docker] | |
endpoint = "unix:///var/run/docker.sock" | |
domain = "MY-DOMAIN" | |
exposedByDefault = false | |
watch = true | |
[acme] | |
email = "MY-EMAIL" | |
storage = "acme.json" | |
entryPoint = "https" | |
onHostRule = true | |
[acme.httpChallenge] | |
entryPoint = "http" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment