infra: rewrote docker-compose for proper integration of librechat
This commit is contained in:
100
docker-compose.yaml
Normal file
100
docker-compose.yaml
Normal file
@@ -0,0 +1,100 @@
|
||||
services:
|
||||
alfred:
|
||||
container_name: alfred-core
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
PYTHON_VERSION: ${PYTHON_VERSION}
|
||||
PYTHON_VERSION_SHORT: ${PYTHON_VERSION_SHORT}
|
||||
RUNNER: ${RUNNER}
|
||||
depends_on:
|
||||
- librechat
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
# LLM Configuration
|
||||
LLM_PROVIDER: ${LLM_PROVIDER:-deepseek}
|
||||
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY:-}
|
||||
|
||||
# Memory storage
|
||||
MEMORY_STORAGE_DIR: /data/memory
|
||||
|
||||
# External services
|
||||
TMDB_API_KEY: ${TMDB_API_KEY:-}
|
||||
QBITTORRENT_URL: ${QBITTORRENT_URL:-}
|
||||
QBITTORRENT_USERNAME: ${QBITTORRENT_USERNAME:-}
|
||||
QBITTORRENT_PASSWORD: ${QBITTORRENT_PASSWORD:-}
|
||||
volumes:
|
||||
- ./data/memory:/data/memory
|
||||
- ./logs:/data/logs
|
||||
# TODO: Development: mount code for hot reload (comment out in production)
|
||||
# - ./alfred:/app/alfred
|
||||
|
||||
librechat:
|
||||
container_name: alfred-librechat
|
||||
image: ghcr.io/danny-avila/librechat:${LIBRECHAT_VERSION}
|
||||
depends_on:
|
||||
- mongodb
|
||||
- meilisearch
|
||||
- rag_api
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
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}
|
||||
ports:
|
||||
- "${LIBRECHAT_PORT:-3080}:3080"
|
||||
volumes:
|
||||
- ./data/librechat/images:/app/client/public/images
|
||||
- ./data/librechat/uploads:/app/client/uploads
|
||||
- ./logs:/app/api/logs
|
||||
# Mount custom endpoint
|
||||
- ./librechat/manifests:/app/manifests:ro
|
||||
- ./librechat/librechat.yaml:/app/librechat.yaml:ro
|
||||
|
||||
mongodb:
|
||||
container_name: alfred-mongodb
|
||||
image: mongo:latest
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./data/mongo:/data/db
|
||||
command: mongod --noauth
|
||||
|
||||
meilisearch:
|
||||
container_name: alfred-meilisearch
|
||||
image: getmeili/meilisearch:v1.12.3
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- MEILI_NO_ANALYTICS=true
|
||||
volumes:
|
||||
- ./data/meili:/meili_data
|
||||
#profiles: ["meili", "full"]
|
||||
|
||||
rag_api:
|
||||
container_name: alfred-rag
|
||||
image: ghcr.io/danny-avila/librechat-rag-api-dev-lite:${RAG_VERSION}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- RAG_PORT=${RAG_PORT:-8000}
|
||||
ports:
|
||||
- "${RAG_PORT:-8000}:${RAG_PORT:-8000}"
|
||||
#profiles: ["rag", "full"]
|
||||
|
||||
vectordb:
|
||||
container_name: alfred-vectordb
|
||||
image: pgvector/pgvector:0.8.0-pg16-bookworm
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_DB=${VECTOR_DB_NAME:-vectordb}
|
||||
- POSTGRES_USER=${VECTOR_DB_USER:-postgres}
|
||||
- POSTGRES_PASSWORD=${VECTOR_DB_PASSWORD:-postgres}
|
||||
ports:
|
||||
- "${VECTOR_DB_PORT:-5432}:5432"
|
||||
volumes:
|
||||
- ./data/vectordb:/var/lib/postgresql/data
|
||||
#profiles: ["rag", "full"]
|
||||
@@ -1,202 +0,0 @@
|
||||
version: "3.4"
|
||||
|
||||
services:
|
||||
alfred:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
RUNNER: ${RUNNER} # Get it from Makefile
|
||||
container_name: alfred
|
||||
restart: unless-stopped
|
||||
env_file: .env
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
# Persistent data volumes (outside container /app)
|
||||
- agent-memory:/data/memory
|
||||
- agent-logs:/data/logs
|
||||
# Development: mount code for hot reload (comment out in production)
|
||||
# - ./alfred:/app
|
||||
environment:
|
||||
# LLM Configuration
|
||||
LLM_PROVIDER: ${LLM_PROVIDER:-deepseek}
|
||||
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY:-}
|
||||
|
||||
# Memory storage
|
||||
MEMORY_STORAGE_DIR: /data/memory
|
||||
|
||||
# External services
|
||||
TMDB_API_KEY: ${TMDB_API_KEY:-}
|
||||
QBITTORRENT_URL: ${QBITTORRENT_URL:-}
|
||||
QBITTORRENT_USERNAME: ${QBITTORRENT_USERNAME:-}
|
||||
QBITTORRENT_PASSWORD: ${QBITTORRENT_PASSWORD:-}
|
||||
networks:
|
||||
- agent-network
|
||||
|
||||
# Da face (LibreChat)
|
||||
librechat:
|
||||
image: ghcr.io/danny-avila/librechat-dev:latest
|
||||
container_name: librechat-frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3080:3080"
|
||||
depends_on:
|
||||
- mongodb
|
||||
- meilisearch
|
||||
- rag_api
|
||||
- alfred
|
||||
env_file: .env
|
||||
environment:
|
||||
# MongoDB connection (no auth, matching LibreChat default)
|
||||
MONGO_URI: mongodb://mongodb:27017/LibreChat
|
||||
|
||||
# App configuration
|
||||
HOST: 0.0.0.0
|
||||
PORT: 3080
|
||||
|
||||
# Security
|
||||
JWT_SECRET: ${JWT_SECRET:-your-super-secret-jwt-key-change-this-in-production}
|
||||
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET:-your-super-secret-refresh-key-change-this-too}
|
||||
CREDS_KEY: ${CREDS_KEY:-your-32-character-secret-key-here}
|
||||
CREDS_IV: ${CREDS_IV:-your-16-character-iv-here}
|
||||
|
||||
# Session
|
||||
SESSION_EXPIRY: ${SESSION_EXPIRY:-1000 * 60 * 15}
|
||||
REFRESH_TOKEN_EXPIRY: ${REFRESH_TOKEN_EXPIRY:-1000 * 60 * 60 * 24 * 7}
|
||||
|
||||
# Domain
|
||||
DOMAIN_CLIENT: ${DOMAIN_CLIENT:-http://localhost:3080}
|
||||
DOMAIN_SERVER: ${DOMAIN_SERVER:-http://localhost:3080}
|
||||
|
||||
# Meilisearch
|
||||
MEILI_HOST: http://meilisearch:7700
|
||||
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:-DrhYf7zENyR6AlUCKmnz0eYASOQdl6zxH7s7MKFSfFU}
|
||||
|
||||
# RAG API
|
||||
RAG_API_URL: http://rag_api:8000
|
||||
|
||||
# Endpoints
|
||||
ENDPOINTS: custom
|
||||
|
||||
# Debug (optional)
|
||||
DEBUG_LOGGING: ${DEBUG_LOGGING:-false}
|
||||
DEBUG_CONSOLE: ${DEBUG_CONSOLE:-false}
|
||||
volumes:
|
||||
- ./librechat/librechat.yaml:/app/librechat.yaml:ro
|
||||
- librechat-images:/app/client/public/images
|
||||
- librechat-logs:/app/api/logs
|
||||
networks:
|
||||
- agent-network
|
||||
|
||||
# MongoDB for LibreChat
|
||||
mongodb:
|
||||
image: mongo:latest
|
||||
container_name: librechat-mongodb
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- mongodb-data:/data/db
|
||||
command: mongod --noauth
|
||||
ports:
|
||||
- "27017:27017"
|
||||
networks:
|
||||
- agent-network
|
||||
|
||||
# Meilisearch - Search engine for LibreChat
|
||||
#TODO: Follow currently used version on librechat's github
|
||||
meilisearch:
|
||||
image: getmeili/meilisearch:v1.12.3
|
||||
container_name: librechat-meilisearch
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- meilisearch-data:/meili_data
|
||||
environment:
|
||||
MEILI_HOST: http://meilisearch:7700
|
||||
MEILI_HTTP_ADDR: meilisearch:7700
|
||||
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:-DrhYf7zENyR6AlUCKmnz0eYASOQdl6zxH7s7MKFSfFU}
|
||||
ports:
|
||||
- "7700:7700"
|
||||
networks:
|
||||
- agent-network
|
||||
|
||||
# PostgreSQL with pgvector for RAG API
|
||||
pgvector:
|
||||
image: ankane/pgvector:latest
|
||||
container_name: librechat-pgvector
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-librechat_rag}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
||||
volumes:
|
||||
- pgvector-data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
networks:
|
||||
- agent-network
|
||||
|
||||
# RAG API - Vector database for LibreChat
|
||||
rag_api:
|
||||
image: ghcr.io/danny-avila/librechat-rag-api-dev-lite:latest
|
||||
container_name: librechat-rag-api
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- pgvector
|
||||
environment:
|
||||
PORT: 8000
|
||||
HOST: 0.0.0.0
|
||||
# PostgreSQL connection (multiple variable names for compatibility)
|
||||
DB_HOST: pgvector
|
||||
DB_PORT: 5432
|
||||
DB_NAME: ${POSTGRES_DB:-librechat_rag}
|
||||
DB_USER: ${POSTGRES_USER:-postgres}
|
||||
DB_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-librechat_rag}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
||||
# RAG configuration
|
||||
COLLECTION_NAME: ${RAG_COLLECTION_NAME:-testcollection}
|
||||
EMBEDDINGS_PROVIDER: ${RAG_EMBEDDINGS_PROVIDER:-openai}
|
||||
EMBEDDINGS_MODEL: ${RAG_EMBEDDINGS_MODEL:-text-embedding-3-small}
|
||||
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
|
||||
RAG_UPLOAD_DIR: /app/uploads
|
||||
volumes:
|
||||
- rag-uploads:/app/uploads
|
||||
ports:
|
||||
- "8001:8000"
|
||||
networks:
|
||||
- agent-network
|
||||
|
||||
# Named volumes for persistent data
|
||||
volumes:
|
||||
# MongoDB data
|
||||
mongodb-data:
|
||||
driver: local
|
||||
|
||||
# Meilisearch data
|
||||
meilisearch-data:
|
||||
driver: local
|
||||
|
||||
# PostgreSQL pgvector data
|
||||
pgvector-data:
|
||||
driver: local
|
||||
|
||||
# RAG API uploads
|
||||
rag-uploads:
|
||||
driver: local
|
||||
|
||||
# LibreChat data
|
||||
librechat-images:
|
||||
driver: local
|
||||
librechat-logs:
|
||||
driver: local
|
||||
|
||||
# Alfred data
|
||||
agent-memory:
|
||||
driver: local
|
||||
agent-logs:
|
||||
driver: local
|
||||
|
||||
# Network for inter-service communication
|
||||
networks:
|
||||
agent-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user