feat: add extra hosts to the web service

This commit is contained in:
Oliver Davies 2023-02-14 14:35:45 +00:00
parent dd68f6c03e
commit 1d7f796538

View file

@ -28,7 +28,12 @@ services:
- web
labels:
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_PROJECT_NAME}.localhost`)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(
`${COMPOSE_PROJECT_NAME}.localhost`,
{% for host in web.extra_hosts | default([]) -%}
{{ '`' ~ host ~ '`,' }}
{% endfor -%}
)"
profiles: [web]
php: