2023-03-08 21:13:28 +00:00
|
|
|
# {{ managedText | raw }}
|
|
|
|
|
2023-01-19 19:47:15 +00:00
|
|
|
x-app: &default-app
|
|
|
|
volumes:
|
2023-03-10 22:19:10 +00:00
|
|
|
- "${DOCKER_WEB_VOLUME:-./{{ drupal.docroot }}:{{ project_root }}/{{ drupal.docroot }}}"
|
2023-01-19 19:47:15 +00:00
|
|
|
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:
|
2023-03-10 22:38:13 +00:00
|
|
|
{% if dockerCompose.services.web != false %}
|
2023-01-19 19:47:15 +00:00
|
|
|
web:
|
|
|
|
<<: *default-app
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
target: web
|
|
|
|
depends_on:
|
|
|
|
- php
|
|
|
|
networks:
|
|
|
|
- default
|
|
|
|
- web
|
|
|
|
labels:
|
|
|
|
- "traefik.docker.network=traefik_proxy"
|
2023-02-14 14:35:45 +00:00
|
|
|
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(
|
|
|
|
`${COMPOSE_PROJECT_NAME}.localhost`,
|
|
|
|
{% for host in web.extra_hosts | default([]) -%}
|
|
|
|
{{ '`' ~ host ~ '`,' }}
|
|
|
|
{% endfor -%}
|
|
|
|
)"
|
2023-01-19 19:47:15 +00:00
|
|
|
profiles: [web]
|
2023-03-10 22:38:13 +00:00
|
|
|
{% endif %}
|
2023-01-19 19:47:15 +00:00
|
|
|
|
2023-03-12 12:23:25 +00:00
|
|
|
{% if "php" == language %}
|
2023-01-19 19:47:15 +00:00
|
|
|
php:
|
|
|
|
<<: *default-app
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
target: {{ dockerCompose.services.php.build.target }}
|
2023-03-10 23:16:39 +00:00
|
|
|
volumes:
|
|
|
|
- .:{{ project_root }}
|
2023-02-03 20:12:06 +00:00
|
|
|
{% if "database" in dockerCompose.services|keys -%}
|
2023-01-19 19:47:15 +00:00
|
|
|
depends_on:
|
|
|
|
- database
|
2023-02-03 20:12:06 +00:00
|
|
|
{% endif -%}
|
2023-01-19 19:47:15 +00:00
|
|
|
profiles: [php]
|
2023-03-12 12:23:25 +00:00
|
|
|
{% elseif "node" == language %}
|
|
|
|
node:
|
|
|
|
<<: *default-app
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
target: build
|
|
|
|
volumes:
|
|
|
|
- .:{{ project_root }}
|
|
|
|
{% if "database" in dockerCompose.services|keys -%}
|
|
|
|
depends_on:
|
|
|
|
- database
|
|
|
|
{% endif -%}
|
|
|
|
profiles: [node]
|
|
|
|
{% endif %}
|
2023-01-19 19:47:15 +00:00
|
|
|
|
2023-02-03 20:12:06 +00:00
|
|
|
{% if "database" in dockerCompose.services|keys %}
|
2023-01-19 19:47:15 +00:00
|
|
|
database:
|
2023-02-03 20:12:06 +00:00
|
|
|
image: {{ database.type }}:{{ database.version }}
|
2023-01-19 19:47:15 +00:00
|
|
|
deploy:
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpus: "${DOCKER_MYSQL_CPUS:-0}"
|
|
|
|
memory: "${DOCKER_MYSQL_MEMORY:-0}"
|
|
|
|
volumes:
|
|
|
|
- db-data:/var/lib/mysql
|
|
|
|
env_file:
|
|
|
|
- .env
|
|
|
|
labels:
|
|
|
|
- "traefik.enabled=false"
|
|
|
|
environment:
|
|
|
|
MYSQL_RANDOM_ROOT_PASSWORD: true
|
|
|
|
profiles: [database]
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
db-data: {}
|
2023-02-03 20:12:06 +00:00
|
|
|
{% endif -%}
|
2023-01-19 19:47:15 +00:00
|
|
|
|
|
|
|
networks:
|
|
|
|
web:
|
|
|
|
name: traefik_proxy
|