How many times have you heard the phrase: “It works on my machine, not sure why it's not working on yours“? This happens when developers have inconsistencies between the tools installed in their machine.
In our docker-compose file, we configured Nginx service port 80 to be mapped and exposed to 8080 in our machine.
For MySQL, we exposed the port 33061 which means we can connect to our MySQL service from our favorite MySQL clients (MySQL WorkBench, Sequel Ace) using port 33061 not 3306.
So if we want PHP service to connect to Mysql, we can’t just say mysql:host=localhost;port:3306;dbname=sample_db; in PHP!