Files
infrastructure/ansible/roles/traefik/templates/docker-compose.yml
2023-02-23 14:32:18 -05:00

48 lines
1.2 KiB
YAML

version: "{{ docker_compose_version }}"
networks:
traefik:
external: true
docker-socket-proxy:
external: true
services:
traefik:
container_name: traefik
image: traefik:v2.9
depends_on:
docker_socket_proxy:
condition: service_healthy
networks:
- traefik
- docker-socket-proxy
ports:
- 80:80 # HTTP
- 443:443 # HTTPS
environment:
PORKBUN_API_KEY: "{{ porkbun_api_key }}"
PORKBUN_SECRET_API_KEY: "{{ porkbun_secret_api_key }}"
volumes:
- "{{ data_dir }}/traefik:/etc/traefik"
labels:
traefik.enable: true
traefik.http.routers.traefik-dashboard.rule: "Host(`traefik.local.{{ personal_domain }}`)"
traefik.http.routers.traefik-dashboard.service: api@internal
traefik.http.routers.traefik-dashboard.middlewares: lan-whitelist@file
docker_socket_proxy:
container_name: docker_socket_proxy
image: tecnativa/docker-socket-proxy:latest
restart: unless-stopped
networks:
- docker-socket-proxy
environment:
- CONTAINERS=1
- SERVICES=1
- INFO=1
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
healthcheck:
test: "exit 0"
start_period: 5s