Last active
September 3, 2018 17:54
-
-
Save felipecwb/49018bd8d75a6722c6d926f2dbfc2771 to your computer and use it in GitHub Desktop.
Traefik and Portainer infrastructure-definition.yml
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.7" | |
services: | |
reverse-proxy: | |
image: traefik | |
command: | |
- "--docker" | |
- "--docker.swarmMode" | |
- "--docker.watch" | |
- "--docker.exposedbydefault=false" | |
# - "--docker.domain=localhost" | |
# - "--defaultentrypoints=http,https" | |
# - "--entrypoints=Name:https Address::443 TLS:/usr/certs/localhost.crt,/usr/certs/localhost.key" | |
- "--web" | |
ports: | |
- target: 80 | |
published: 80 | |
mode: host | |
- target: 443 | |
published: 443 | |
mode: host | |
networks: | |
- frontend | |
volumes: | |
- ./certs/:/usr/certs | |
- /var/run/docker.sock:/var/run/docker.sock | |
deploy: | |
mode: global | |
update_config: | |
parallelism: 2 | |
delay: 10s | |
order: start-first | |
restart_policy: | |
condition: any | |
placement: | |
constraints: [node.role == manager] | |
labels: | |
- "traefik.enable=true" | |
- "traefik.port=8080" | |
- "traefik.frontend.rule=Host:proxy.localhost" | |
depends_on: | |
- reverse-proxy | |
portainer: | |
image: portainer/portainer | |
command: -H unix:///var/run/docker.sock | |
networks: | |
- frontend | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- data_portainer:/data | |
deploy: | |
mode: global | |
update_config: | |
parallelism: 2 | |
delay: 10s | |
restart_policy: | |
condition: any | |
delay: 5s | |
placement: | |
constraints: [node.role == manager] | |
labels: | |
- "traefik.enable=true" | |
- "traefik.port=9000" | |
- "traefik.frontend.rule=Host:portainer.localhost" | |
whoami: | |
image: emilevauge/whoami | |
networks: | |
- frontend | |
deploy: | |
replicas: 1 | |
restart_policy: | |
condition: any | |
max_attempts: 3 | |
delay: 5s | |
labels: | |
- "traefik.enable=true" | |
- "traefik.port=80" | |
- "traefik.frontend.rule=Host:localhost;PathPrefix:/_whoami" | |
networks: | |
frontend: | |
external: true | |
volumes: | |
data_portainer: | |
external: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment