mirror of
https://github.com/opdavies/build-configs.git
synced 2025-03-20 04:00:54 +00:00
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:
parent
a9a4925515
commit
ddb1bcd58d
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue