260 lines
6.3 KiB
YAML
260 lines
6.3 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
api:
|
|
# build:
|
|
# context: .
|
|
# dockerfile: Dockerfile.multi
|
|
# target: api-build
|
|
image: ghcr.io/danny-avila/librechat-dev-api:latest
|
|
# ports:
|
|
# - 3080:3080
|
|
# Note: depends_on is ignored in Docker Swarm mode
|
|
# Services start in parallel, so API must handle connection retries
|
|
# depends_on:
|
|
# - mongodb
|
|
# - rag_api
|
|
networks:
|
|
- net
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
env_file:
|
|
- stack.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: /home/trav/dkr/LibreChat/librechat.yaml
|
|
target: /app/librechat.yaml
|
|
- /home/trav/dkr/LibreChat/images:/app/client/public/images
|
|
- /home/trav/dkr/LibreChat/uploads:/app/uploads
|
|
- /home/trav/dkr/LibreChat/logs:/app/api/logs
|
|
- /home/trav/claude-scripts:/mnt/claude-scripts
|
|
- /home/trav/dkr:/mnt/dkr
|
|
- /home/trav/biz-bud:/mnt/biz-bud
|
|
- /home/trav/portainer:/mnt/portainer
|
|
- /home/trav/repos:/mnt/repos
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:3080/health || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
delay: 20s
|
|
max_attempts: 10
|
|
window: 2m
|
|
update_config:
|
|
parallelism: 1
|
|
delay: 20s
|
|
failure_action: rollback
|
|
placement:
|
|
constraints:
|
|
- node.hostname == little
|
|
|
|
client:
|
|
image: nginx:1.27.0-alpine
|
|
# ports:
|
|
# - 80:80
|
|
# - 443:443
|
|
# Note: depends_on is ignored in Docker Swarm mode
|
|
# depends_on:
|
|
# - api
|
|
networks:
|
|
- net
|
|
- badge-net
|
|
volumes:
|
|
- /home/trav/dkr/LibreChat/client/nginx.conf:/etc/nginx/conf.d/default.conf
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
delay: 15s
|
|
max_attempts: 10
|
|
window: 2m
|
|
update_config:
|
|
parallelism: 1
|
|
delay: 15s
|
|
failure_action: rollback
|
|
placement:
|
|
constraints:
|
|
- node.hostname == little
|
|
|
|
mongodb:
|
|
# ports: # Uncomment this to access mongodb from outside docker, not safe in deployment
|
|
# - 27018:27017
|
|
image: mongo
|
|
networks:
|
|
- net
|
|
volumes:
|
|
- librechat-mongodb:/data/db
|
|
command: mongod --noauth
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "mongosh --eval 'db.adminCommand(\"ping\")' --quiet || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
delay: 20s
|
|
max_attempts: 15
|
|
window: 3m
|
|
update_config:
|
|
parallelism: 1
|
|
delay: 20s
|
|
failure_action: rollback
|
|
placement:
|
|
constraints:
|
|
- node.hostname == little
|
|
|
|
meilisearch:
|
|
image: getmeili/meilisearch:v1.12.3
|
|
networks:
|
|
- net
|
|
# 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:
|
|
- stack.env
|
|
environment:
|
|
- MEILI_HOST=http://meilisearch:7700
|
|
- MEILI_NO_ANALYTICS=true
|
|
volumes:
|
|
- librechat-meili_data:/meili_data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:7700/health || wget --spider -q http://localhost:7700/health || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
delay: 20s
|
|
max_attempts: 15
|
|
window: 3m
|
|
update_config:
|
|
parallelism: 1
|
|
delay: 20s
|
|
failure_action: rollback
|
|
placement:
|
|
constraints:
|
|
- node.hostname == little
|
|
|
|
vectordb:
|
|
image: pgvector/pgvector:0.8.0-pg15-trixie
|
|
environment:
|
|
POSTGRES_DB: mydatabase
|
|
POSTGRES_USER: myuser
|
|
POSTGRES_PASSWORD: mypassword
|
|
networks:
|
|
- net
|
|
volumes:
|
|
- librechat-pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U myuser -d mydatabase"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
delay: 20s
|
|
max_attempts: 15
|
|
window: 3m
|
|
update_config:
|
|
parallelism: 1
|
|
delay: 20s
|
|
failure_action: rollback
|
|
placement:
|
|
constraints:
|
|
- node.hostname == little
|
|
|
|
rag_api:
|
|
image: ghcr.io/danny-avila/librechat-rag-api-dev-lite:latest
|
|
environment:
|
|
- DB_HOST=vectordb
|
|
- RAG_PORT=${RAG_PORT:-8000}
|
|
networks:
|
|
- net
|
|
# Note: depends_on is ignored in Docker Swarm mode
|
|
# depends_on:
|
|
# - vectordb
|
|
env_file:
|
|
- stack.env
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "python3 -c \"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')\""]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 40s
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
delay: 20s
|
|
max_attempts: 15
|
|
window: 3m
|
|
update_config:
|
|
parallelism: 1
|
|
delay: 20s
|
|
failure_action: rollback
|
|
placement:
|
|
constraints:
|
|
- node.hostname == little
|
|
|
|
metrics:
|
|
image: ghcr.io/virtuos/librechat_exporter:main
|
|
# Note: depends_on is ignored in Docker Swarm mode
|
|
# depends_on:
|
|
# - mongodb
|
|
# ports:
|
|
# - "8000:8000"
|
|
networks:
|
|
- net
|
|
- observability_observability
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
delay: 15s
|
|
max_attempts: 10
|
|
window: 2m
|
|
update_config:
|
|
parallelism: 1
|
|
delay: 15s
|
|
failure_action: rollback
|
|
placement:
|
|
constraints:
|
|
- node.hostname == little
|
|
|
|
volumes:
|
|
librechat-pgdata:
|
|
name: librechat-pgdata
|
|
librechat-mongodb:
|
|
name: librechat-mongodb
|
|
librechat-meili_data:
|
|
name: librechat-meili_data
|
|
|
|
networks:
|
|
net:
|
|
driver: overlay
|
|
attachable: true
|
|
badge-net:
|
|
external: true
|
|
observability_observability:
|
|
external: true
|