2👍
✅
You can control all the behavior of your application with environment variables from the host machine taking advantage of the variable substitution feature of docker compose. For example the POSTGRES_USER, POSTGRES_PASSWORD can be define as enviroment variables in you dev machine and in your deployment machine with different values.
Also you can have two different build images defined and using each one depending on env variable
build: ./project-${HOST}
and in project-dev
have a Dockerfile with dev dependencies and in project-deploy
another Dockerfile.
Source:stackexchange.com