mirror of
https://github.com/opdavies/build-configs.git
synced 2025-01-23 02:27:33 +00:00
58 lines
1.1 KiB
Twig
58 lines
1.1 KiB
Twig
|
# {{ 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
|