Skip to content

Allow to configure from environment the docker compose services dependencies

SHORT DESCRIPTION (required)

From the .env must be possible to configure the docker compose services dependencies.

USER HISTORY (required)

Currently the docker composer services dependencies are configured in the docker compose file by using the depends_on that in docker compose v3 does not support the healthy checks, thus loosing is most important feature. More details on this issue int the docker compose repo. According with this same issue docker compose may be deprecated in a near future once now the official docker cli tool as docker stack command to achieve the same purpose of the unofficial docker compose tool. Reading this article it seems that both docker stack and docker compose can interpret the same docker-compose.yml with a few nuances.

So moving the dependencies management to the bash cli with configuration from the .env will allow us to adapt the dependencies for each docker compose service easily to each project using the Php Docker Stack and at same time avoiding the limitations of a future move to the official docker stack command in detriment of the current docker-compose tool.

EXPECTED BEHAVIUOR (required)

From the .env file should be possible to specify the dependencies more or less in the following way:

# this mimics the current dependencies graph in docker compose file.

HTTP_SERVICE_DEPENDS_ON=php
PHP_SERVICE_DEPENDS_ON=database,cache,queue,logs-dashboard
LOGS_DASHBOARD_SERVICE_DEPENDS_ON=logs-pipeline,
LOGS_PIPELINE_SERVICE_DEPENDS_ON=logs-storage

Each service should only be started after healthy checks confirmed that all is dependencies are up and running. This healthy checks will be need to be performed with bash scripts.

RELATED TO (optional)

N/A

DEPENDS ON (optional)

N/A

LINKS (optional)

N/A