diff --git a/deploy-compose.yml b/deploy-compose.yml index 968768b818..51844f9776 100644 --- a/deploy-compose.yml +++ b/deploy-compose.yml @@ -9,8 +9,10 @@ services: ports: - 3080:3080 depends_on: - - mongodb - - rag_api + mongodb: + condition: service_healthy + rag_api: + condition: service_started restart: always extra_hosts: - "host.docker.internal:host-gateway" @@ -51,6 +53,12 @@ services: volumes: - ./data-node:/data/db command: mongod --noauth + healthcheck: + test: ["CMD", "bash", "-c", "echo > /dev/tcp/localhost/27017"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 10s meilisearch: container_name: chat-meilisearch image: getmeili/meilisearch:v1.35.1 @@ -73,6 +81,12 @@ services: restart: always volumes: - pgdata2:/var/lib/postgresql/data + healthcheck: + test: ["CMD", "bash", "-c", "echo > /dev/tcp/localhost/5432"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 10s rag_api: image: registry.librechat.ai/danny-avila/librechat-rag-api-dev-lite:latest environment: @@ -80,7 +94,8 @@ services: - RAG_PORT=${RAG_PORT:-8000} restart: always depends_on: - - vectordb + vectordb: + condition: service_healthy env_file: - .env diff --git a/docker-compose.yml b/docker-compose.yml index 079cdb74b6..3f32d468b5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,8 +7,10 @@ services: ports: - "${PORT}:${PORT}" depends_on: - - mongodb - - rag_api + mongodb: + condition: service_healthy + rag_api: + condition: service_started image: registry.librechat.ai/danny-avila/librechat-dev:latest restart: always user: "${UID}:${GID}" @@ -35,6 +37,12 @@ services: volumes: - ./data-node:/data/db command: mongod --noauth + healthcheck: + test: ["CMD", "bash", "-c", "echo > /dev/tcp/localhost/27017"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 10s meilisearch: container_name: chat-meilisearch image: getmeili/meilisearch:v1.35.1 @@ -56,6 +64,12 @@ services: restart: always volumes: - pgdata2:/var/lib/postgresql/data + healthcheck: + test: ["CMD", "bash", "-c", "echo > /dev/tcp/localhost/5432"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 10s rag_api: container_name: rag_api image: registry.librechat.ai/danny-avila/librechat-rag-api-dev-lite:latest @@ -64,7 +78,8 @@ services: - RAG_PORT=${RAG_PORT:-8000} restart: always depends_on: - - vectordb + vectordb: + condition: service_healthy env_file: - .env diff --git a/rag.yml b/rag.yml index 9684d76cf5..ff4b43d52f 100644 --- a/rag.yml +++ b/rag.yml @@ -11,6 +11,12 @@ services: - pgdata2:/var/lib/postgresql/data ports: - "5433:5432" + healthcheck: + test: ["CMD", "bash", "-c", "echo > /dev/tcp/localhost/5432"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 10s rag_api: image: registry.librechat.ai/danny-avila/librechat-rag-api-dev:latest @@ -23,7 +29,8 @@ services: ports: - "${RAG_PORT}:${RAG_PORT}" depends_on: - - vectordb + vectordb: + condition: service_healthy env_file: - .env