mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-04-07 00:15:23 +02:00
Add bash /dev/tcp health checks to MongoDB (port 27017) and PostgreSQL/ pgvector (port 5432) services, which previously had no health checks. Update depends_on conditions so dependent services (rag_api, api) wait for their database dependencies to be healthy before starting. Files changed: docker-compose.yml, deploy-compose.yml, rag.yml Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
103 lines
2.7 KiB
YAML
103 lines
2.7 KiB
YAML
services:
|
|
api:
|
|
# build:
|
|
# context: .
|
|
# dockerfile: Dockerfile.multi
|
|
# target: api-build
|
|
image: registry.librechat.ai/danny-avila/librechat-dev-api:latest
|
|
container_name: LibreChat-API
|
|
ports:
|
|
- 3080:3080
|
|
depends_on:
|
|
mongodb:
|
|
condition: service_healthy
|
|
rag_api:
|
|
condition: service_started
|
|
restart: always
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- HOST=0.0.0.0
|
|
- NODE_ENV=production
|
|
- MONGO_URI=mongodb://mongodb:27017/LibreChat
|
|
- MEILI_HOST=http://meilisearch:7700
|
|
- RAG_PORT=${RAG_PORT:-8000}
|
|
- RAG_API_URL=http://rag_api:${RAG_PORT:-8000}
|
|
volumes:
|
|
- type: bind
|
|
source: ./librechat.yaml
|
|
target: /app/librechat.yaml
|
|
- ./images:/app/client/public/images
|
|
- ./uploads:/app/uploads
|
|
- ./logs:/app/api/logs
|
|
|
|
client:
|
|
image: nginx:1.27.0-alpine
|
|
container_name: LibreChat-NGINX
|
|
ports:
|
|
- 80:80
|
|
- 443:443
|
|
depends_on:
|
|
- api
|
|
restart: always
|
|
volumes:
|
|
- ./client/nginx.conf:/etc/nginx/conf.d/default.conf
|
|
mongodb:
|
|
container_name: chat-mongodb
|
|
# ports: # Uncomment this to access mongodb from outside docker, not safe in deployment
|
|
# - 27018:27017
|
|
image: mongo:8.0.17
|
|
restart: always
|
|
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
|
|
restart: always
|
|
# ports: # Uncomment this to access meilisearch from outside docker
|
|
# - 7700:7700 # if exposing these ports, make sure your master key is not the default value
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- MEILI_HOST=http://meilisearch:7700
|
|
- MEILI_NO_ANALYTICS=true
|
|
volumes:
|
|
- ./meili_data_v1.35.1:/meili_data
|
|
vectordb:
|
|
image: pgvector/pgvector:0.8.0-pg15-trixie
|
|
environment:
|
|
POSTGRES_DB: mydatabase
|
|
POSTGRES_USER: myuser
|
|
POSTGRES_PASSWORD: mypassword
|
|
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:
|
|
- DB_HOST=vectordb
|
|
- RAG_PORT=${RAG_PORT:-8000}
|
|
restart: always
|
|
depends_on:
|
|
vectordb:
|
|
condition: service_healthy
|
|
env_file:
|
|
- .env
|
|
|
|
volumes:
|
|
pgdata2:
|