Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(self-host): wait for NuQ PostgreSQL readiness (#4643)

lorenzozane72ab7154ed70
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 233f44bc3..3398391d5 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -111,6 +111,11 @@ services:
condition: service_started
rabbitmq:
condition: service_healthy
+ # Only the pg backend uses nuq-postgres, so an unhealthy Postgres must not
+ # block startup when NUQ_BACKEND=fdb.
+ nuq-postgres:
+ condition: service_healthy
+ required: false
ports:
- "${PORT:-3002}:${INTERNAL_PORT:-3002}"
volumes:
@@ -166,6 +171,16 @@ services:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
+ healthcheck:
+ test:
+ [
+ "CMD-SHELL",
+ "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-postgres}",
+ ]
+ interval: 5s
+ timeout: 5s
+ retries: 5
+ start_period: 5s
networks:
- backend
logging: