Replies: 1 comment
|
DB_MYSQL_HOST: mysql is perfectly fine — Docker Compose service names can be used as DNS names. The service does not have to be named db. The actual problem in your compose file is that the two containers are not on the same Docker network. nginx is explicitly attached to: but the mysql service has no networks: entry, so Compose places it on the project's default network. As a result, the nginx container cannot resolve the hostname mysql, which explains:
You also have a typo here:
It should be:
Then recreate the stack: You can verify Docker DNS resolution from the NPM container with: If it returns the MySQL container IP, the networking part is fixed. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I got an error saying "getaddrinfo EAI_AGAIN mysql" after running docker compose up. I don't know what I'm doing wrong. Is it supposed to use the "db" parameter instead of a custom one?
Here is my
compose.yamlfile:All reactions