awesome-compose/traefik-golang/docker-compose.yml
lfache 3a0f551e33
Adding simple Traefik example. (#44)
Adding simple Traefik example.

Signed-off-by: lfache <61111030+lfache@users.noreply.github.com>
2020-04-07 21:32:26 +02:00

20 lines
548 B
YAML

version: "3.7"
services:
frontend:
image: traefik:2.2
command: --providers.docker --entrypoints.web.address=:80 --providers.docker.exposedbydefault=false
ports:
# The HTTP port
- "80:80"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- backend
backend:
build: backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.go.rule=Path(`/`)"
- "traefik.http.services.go.loadbalancer.server.port=80"