Docker/docker-compose.yml

37 lines
1.1 KiB
YAML

version: '3'
services:
whoami:
# A container that exposes an API to show its IP address
image: containous/whoami
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.localhost`)"
- "traefik.http.routers.whoami.entrypoints=web"
reverse-proxy:
# The official v2.0 Traefik docker image
image: traefik:v2.0
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
# The HTTP port
- "80:80"
#- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.yml:/etc/traefik/traefik.yml
- ./static_config.yml:/etc/traefik/static_config.yml
labels:
- "traefik.http.routers.traefik.rule=Host(`tr.localhost`)"
- "traefik.http.routers.traefik.entrypoints=web"
- "traefik.http.services.service1.loadbalancer.server.port=8080"
- "traefik.enable=true"