add healthcheck for postgres #143

Closed
opened 2025-07-08 08:41:18 -04:00 by AtHeartEngineer · 0 comments

Originally created by @MrToWy on 2/14/2025

Endurain ran into errors when starting the docker container.
By adding a healthcheck, the application waits for the database to start. This solves the error.

2025-02-14 17:17:35 endurain  | sqlalchemy.exc.OperationalError: (psycopg.OperationalError) connection failed: connection to server at "172.22.0.2", port 5432 failed: Connection refused
2025-02-14 17:17:35 endurain  |         Is the server running on that host and accepting TCP/IP connections?
2025-02-14 17:17:35 endurain  | (Background on this error at: https://sqlalche.me/e/20/e3q8)
2025-02-14 17:17:35 endurain  | 
2025-02-14 17:17:35 endurain  | ERROR:    Application startup failed. Exiting.
*Originally created by @MrToWy on 2/14/2025* Endurain ran into errors when starting the docker container. By adding a healthcheck, the application waits for the database to start. This solves the error. ``` 2025-02-14 17:17:35 endurain | sqlalchemy.exc.OperationalError: (psycopg.OperationalError) connection failed: connection to server at "172.22.0.2", port 5432 failed: Connection refused 2025-02-14 17:17:35 endurain | Is the server running on that host and accepting TCP/IP connections? 2025-02-14 17:17:35 endurain | (Background on this error at: https://sqlalche.me/e/20/e3q8) 2025-02-14 17:17:35 endurain | 2025-02-14 17:17:35 endurain | ERROR: Application startup failed. Exiting. ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/endurain#143