feat: make the database values configurable

- Allow for setting a database `type` and `version`.
- Don't add a `database` service to docker-compose.yaml if there is no
  key within `docker-compose`.

Fixes #14
This commit is contained in:
Oliver Davies 2023-02-03 20:12:06 +00:00
parent a9a4925515
commit ddb1bcd58d

View file

@ -36,12 +36,15 @@ services:
build: build:
context: . context: .
target: {{ dockerCompose.services.php.build.target }} target: {{ dockerCompose.services.php.build.target }}
{% if "database" in dockerCompose.services|keys -%}
depends_on: depends_on:
- database - database
{% endif -%}
profiles: [php] profiles: [php]
{% if "database" in dockerCompose.services|keys %}
database: database:
image: mariadb:10 image: {{ database.type }}:{{ database.version }}
deploy: deploy:
resources: resources:
limits: limits:
@ -59,6 +62,7 @@ services:
volumes: volumes:
db-data: {} db-data: {}
{% endif -%}
networks: networks:
web: web: