Open danzhechen opened 6 months ago
In your docker ps
output, under the ports
section, I see the line 0.0.0.0:9999->5432/tcp
for your postgres database. This tells me that you have routed port 9999 on the lambda server to port 5432 on the postgres database. This is not "wrong" in the sense that it will mess things up, but it's not necessary and tells me that you're having a misunderstanding about ports that is causing this problem.
The web service is contained on the same network as the database, and so you do not need to expose a port on the database server in order to access it. The connection url should be changed from
postgresql://postgres:pass@localhost:9998
to something more like
postgresql://postgres:pass@postgres:5432
That may not be exactly correct for your configuration, but fixing this url is the thing you need to do.
Hey everyone,
UPDATE
I edited my
.env.dev
file to beThis seems to fixed the first issue, but I still got the issue of
Origin I am working on the final project and I am at the first two steps to make sure my docker is running. I just
docker-compose up -d --build
to build the docker and when runningdocker ps
, both dockers are running on my side, which shows,but when I run
docker logs c68fe6c5d085
, it shows thatThe other docker has this message,
What might be the reason? How can I fix that?