Split docker-compose.yml
and env-example
into smaller files
#1053
Labels
docker-compose.yml
and env-example
into smaller files
#1053
Currently, the
docker-compose.yml
is one large file for all the containers defined and theenv-example
is one large file that contains all the environment variables. As the number of images and containers continues to increase this becomes more and more difficult manage, maintain and extend easily.Originally, I tried to reorder the sections in the
env-example
based on the ordering in thedocker-compose.yml
, but I thought they still will be two very large files. So, why not split thedocker-compose.yml
into smaller files, one for each image, and split theenv-example
similarly, one for eachdocker-compose.yml
, approximately.The
docker-compose.yml
files can be composed together using the-f
option in thedocker-compose
command and theenv-example
files can concatenated together via a shell script or the laradock/cli.This way it is more modular and we can add new images by adding a
docker-compose.yml
and.env.example
and registering the module in the shell script.scripts/laradock.sh environvars:template --output .env docker-compose $(scripts/laradock.sh dockercompose:args) up
Other benefits:
I can choose which modules to include when generating my
.env
and composing mydocker-compose.yml
, keeping my.env
relatively small with only the modules I need. For instance:I can write an
.env.example
with only the variables that I want to modify and override the defaultvariables in the modules that I chose to include. For example:
../.env.example
:Currently, it is a work in progress, here: https://github.com/vwchu/laradock/tree/feat-split-configs
Any thoughts?
The text was updated successfully, but these errors were encountered: