ansible-role-chill/templates/traefik-compose.yaml

49 lines
1.3 KiB
YAML
Raw Normal View History

2024-12-19 10:05:25 +00:00
services:
reverse-proxy:
# The official v3 Traefik docker image
image: traefik:v3.2
# Enables the web UI and tells Traefik to listen to docker
command:
{% if traefik_debug|default(False) -%}
2024-12-19 10:05:25 +00:00
- "--log.level=debug"
{% endif -%}
{% if traefik_insecure|default(False) -%}
2024-12-19 10:05:25 +00:00
- "--api.insecure=true"
{% endif -%}
2024-12-19 10:05:25 +00:00
- "--providers.docker=true"
- "--providers.docker.exposedByDefault=false"
- "--entryPoints.web.address=:80"
2024-12-30 10:37:55 +00:00
- "--entryPoints.websecure.address=:443"
{%+ for c in chills +%}
{%+ if c.expose_port is not false +%}
- "--entryPoints.chill{{ c.chill_environment }}.address=:{{ c.expose_port }}"
{% endif +%}
{% endfor +%}
2024-12-19 10:05:25 +00:00
ports:
# The HTTP port
- "80:80"
2024-12-30 10:37:55 +00:00
- "443:443"
2024-12-19 10:05:25 +00:00
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
2024-12-30 10:37:55 +00:00
{% for c in chills +%}
{% if c.expose_port is not false +%}
- "{{ c.expose_port }}:{{ c.expose_port }}"
{% endif +%}
{%+ endfor +%}
2024-12-19 10:05:25 +00:00
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
2024-12-30 10:37:55 +00:00
- /var/traefik/certs:/var/traefik/certs
2024-12-19 10:05:25 +00:00
networks:
- traefik
networks:
traefik:
2024-12-30 10:37:55 +00:00
name: traefik
driver: bridge
ipam:
config:
- subnet: 172.150.0.0/24