build-configs/templates/fractal/docker-compose.yaml.twig

58 lines
1.1 KiB
Twig
Raw Normal View History

# {{ managedText|raw }}
x-proxy: &default-proxy
networks:
- default
- web
labels:
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(
`${COMPOSE_PROJECT_NAME}.localhost`,
{% for host in web.extra_hosts | default([]) -%}
{{ '`' ~ host ~ '`,' }}
{%- endfor %}
)"
x-app: &default-app
volumes:
- "${DOCKER_WEB_VOLUME:-./:{{ project_root }}}"
env_file:
- .env
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
networks:
- default
deploy:
resources:
limits:
cpus: "${DOCKER_MYSQL_CPUS:-0}"
memory: "${DOCKER_MYSQL_MEMORY:-0}"
labels:
- "traefik.enabled=false"
tty: true
services:
{% if "web" in dockerCompose.services %}
web:
<<: [*default-proxy, *default-app]
build:
context: .
target: web
depends_on:
- php
profiles: [web]
{% endif %}
node:
<<: [*default-proxy, *default-app]
build:
context: .
target: build
volumes:
- .:{{ project_root }}
profiles: [node]
networks:
web:
external: true
name: traefik_proxy