PHP-Error in dockerized php dev environment

Hi!

I am running a PHP dev env in different docker containers. Unfortunately I do not succeed in connecting from the PHP code to my database container by using PDO.
In a different container I am running PHPMyAdmin which can connect to the database.

The same setup works perfectly on the same docker environment but for another project with a different docker-compose file and different names.

I was able to reproduce the error on a brand new virtual machine successfully :frowning:

The code for that environment is available on GitHub.
And I already discussed the error message on Stackoverflow - unfortunately not successfull.

Anyone here able to help me with that issue?

Regards,
Olaf

In my environment everything works fine. But when I try to fire up another environment from the same docker compose file but with other namings of the services I am not able to connect from my PHP code to the database. My dedicated PHPMyAdmin container can connect but my own code, based on PDO, cannot connect.

I also filed that issue at stackoverflow: https://stackoverflow.com/questions/63111681/sqlstatehy000-2002-no-such-file-or-directory-when-connecting-via-pdo-from-ph?noredirect=1#comment111603123_63111681

And you can find the files at GitHub - okoestner/dockerissue: Repo with the docker issue for further investigation

Any additional idea on how to get that working?