mirror of
https://github.com/opdavies/build-configs.git
synced 2025-02-02 05:47:32 +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:
|
||||
context: .
|
||||
target: {{ dockerCompose.services.php.build.target }}
|
||||
{% if "database" in dockerCompose.services|keys -%}
|
||||
depends_on:
|
||||
- database
|
||||
{% endif -%}
|
||||
profiles: [php]
|
||||
|
||||
{% if "database" in dockerCompose.services|keys %}
|
||||
database:
|
||||
image: mariadb:10
|
||||
image: {{ database.type }}:{{ database.version }}
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
|
@ -59,6 +62,7 @@ services:
|
|||
|
||||
volumes:
|
||||
db-data: {}
|
||||
{% endif -%}
|
||||
|
||||
networks:
|
||||
web:
|
||||
|
|
Loading…
Reference in a new issue