Last active
April 24, 2020 04:27
-
-
Save gpilla/673a9850f607a3d2408614c2ca5a31d1 to your computer and use it in GitHub Desktop.
This file contains 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' | |
services: | |
reverse-proxy: | |
image: traefik:v2.2 | |
command: | |
- --api.insecure=true | |
- --api.dashboard=true | |
- --providers.docker=true | |
- --providers.docker.swarmMode=true | |
- --providers.docker.exposedbydefault=false | |
- --providers.docker.network=proxy | |
- --entrypoints.http.address=:80 | |
- --entrypoints.https.address=:443 | |
ports: | |
# The HTTP port | |
- "80:80" | |
- "443:443" | |
volumes: | |
# So that Traefik can listen to the Docker events | |
- /var/run/docker.sock:/var/run/docker.sock | |
networks: | |
- proxy | |
deploy: | |
placement: | |
constraints: | |
- node.role == manager | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.routers.api.rule=Host(`dashboard.traefik.localhost`)" | |
- "traefik.http.routers.api.service=api@internal" | |
- "traefik.http.routers.api.entrypoints=http" | |
- "traefik.http.services.api.loadbalancer.server.port=80" | |
networks: | |
proxy: | |
external: true |
This file contains 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' | |
services: | |
whoami: | |
# A container that exposes an API to show its IP address | |
image: containous/whoami | |
networks: | |
- proxy | |
deploy: | |
labels: | |
- "traefik.http.routers.whoami.rule=Host(`whoami.localhost`)" | |
- "traefik.enable=true" | |
- "traefik.http.routers.whoami.entrypoints=http" | |
- "traefik.http.services.whoami.loadbalancer.server.port=80" | |
networks: | |
proxy: | |
external: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment