DEV Community

Discussion on: Deploying Your Laravel App on Docker, With NGINX and MySQL

Collapse
 
reykario profile image
Reynald Karisma

Nice Tutorial!

I have following your example for my production docker environment. However when i tried to create another database container for testing it cannot connect to the testing database. I tried to track the problem and it lead me to the environment variable in docker-compose.yml in app container. When i try to remove the enviroment variable the apps cannot connect to the database at all.

Can you explain how the environment variable working ? and can we made that value dynamic (consider my condition i required the apps to connected into different container database)