connect: connection refused with modified Docker compose file #8350
-
|
Having followed the instructions for set up with Docker compose here I now face this error from the lobe-casdoor container:
Here they are for full context: My system:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi @DesertCookie! I'm Dosu and I’m helping the lobe-chat team. The issue is that your Casdoor and Lobe Chat containers are trying to connect to Postgres on port 5439, but inside Docker, Postgres is only listening on its default internal port 5432. The port mapping '5439:5432' only affects host-to-container access, not container-to-container communication. For services talking to each other inside Docker, always use the internal port (5432) in your connection strings and environment variables, not the mapped host port. To fix this, update all references to the Postgres port in your Docker Compose and environment files (especially Casdoor's After making these changes, restart your Docker Compose stack. If you still see issues, check the logs for the Postgres, Casdoor, and Lobe Chat containers to confirm everything is healthy and using the correct ports. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Hi @DesertCookie! I'm Dosu and I’m helping the lobe-chat team.
The issue is that your Casdoor and Lobe Chat containers are trying to connect to Postgres on port 5439, but inside Docker, Postgres is only listening on its default internal port 5432. The port mapping '5439:5432' only affects host-to-container access, not container-to-container communication. For services talking to each other inside Docker, always use the internal port (5432) in your connection strings and environment variables, not the mapped host port.
To fix this, update all references to the Postgres port in your Docker Compose and environment files (especially Casdoor's
dataSourceNameand Lobe Chat'sDATABASE_URL) to u…