I don’t know whether you would have seen an issue like this before but when I’m using Laravel which is what I use all the time with Docker I have an issue.
For anyone who knows Laravel knows you get the .env file. In this env file we have to set the DB_HOST. Now locally the DB_HOST is 127.0.0.1 whereas within the Docker container the host is actually just database.
Obviously putting 127.0.0.1 does not allow the Docker container to connect to the database and putting database does not like the host machine connect to that’ll database.
I need to put 127.0.0.1 but also for Docker to recognise this and point it to the database container.