LibreChat/docker-compose.yml
Will Wilson 0bcebac21c fix: use TCP socket health checks for database services
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>
2026-03-08 21:41:15 +00:00

87 lines
2.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Do not edit this file directly. Use a docker-compose.override.yaml file if you can.
# Refer to `docker-compose.override.yaml.example for some sample configurations.
services:
api:
container_name: LibreChat
ports:
- "${PORT}:${PORT}"
depends_on:
mongodb:
condition: service_healthy
rag_api:
condition: service_started
image: registry.librechat.ai/danny-avila/librechat-dev:latest
restart: always
user: "${UID}:${GID}"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- HOST=0.0.0.0
- 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: ./.env
target: /app/.env
- ./images:/app/client/public/images
- ./uploads:/app/uploads
- ./logs:/app/logs
mongodb:
container_name: chat-mongodb
image: mongo:8.0.17
restart: always
user: "${UID}:${GID}"
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
user: "${UID}:${GID}"
environment:
- MEILI_HOST=http://meilisearch:7700
- MEILI_NO_ANALYTICS=true
- MEILI_MASTER_KEY=${MEILI_MASTER_KEY}
volumes:
- ./meili_data_v1.35.1:/meili_data
vectordb:
container_name: 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:
container_name: 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: