zerotier-app starts before zerotier-db is ready, causing database connection errors
#2
Replies: 1 comment
-
|
That's actually my |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm running the tiredofit/zerotier Docker image with Docker Compose on Windows 10 using Docker Desktop with WSL2 backend.
I noticed that when I do
docker-compose up -d, thezerotier-appcontainer starts before thezerotier-db(PostgreSQL) service is fully ready, causing repeated connection errors like:"[WARN] Postgres Host 'zerotier-db' is not accessible, retrying..."
This happens because Docker Compose's
depends_ononly waits for container start, not for service readiness.To fix this, I suggest adding a healthcheck to the
zerotier-dbservice (usingpg_isready) and configuringdepends_on.conditionin the compose file, so thatzerotier-appwaits for the database to be healthy before starting.This would improve startup reliability and reduce confusing log entries.
Thanks for your great work on this project!
Best regards
Beta Was this translation helpful? Give feedback.
All reactions