Replaces the minimal project description with a comprehensive README including a component overview table, quick start instructions, common Ansible operations, and links to detailed documentation. Aligns with Red Panda Approval™ standards.
394 lines
11 KiB
YAML
394 lines
11 KiB
YAML
networks:
|
|
frontend:
|
|
driver: bridge
|
|
backend:
|
|
driver: bridge
|
|
monitoring:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
anythingllm_data:
|
|
driver: local
|
|
postgres_data:
|
|
driver: local
|
|
prometheus_data:
|
|
driver: local
|
|
loki_data:
|
|
driver: local
|
|
grafana_data:
|
|
driver: local
|
|
|
|
services:
|
|
# ============================================
|
|
# PostgreSQL with pgvector Extension
|
|
# ============================================
|
|
postgres:
|
|
image: pgvector/pgvector:pg17
|
|
container_name: anythingllm-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB:-anythingllm}
|
|
POSTGRES_USER: ${POSTGRES_USER:-anythingllm}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
|
|
POSTGRES_INITDB_ARGS: "-E UTF8"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./scripts/init-pgvector.sql:/docker-entrypoint-initdb.d/init-pgvector.sql:ro
|
|
networks:
|
|
- backend
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-anythingllm}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 2G
|
|
reservations:
|
|
memory: 1G
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
labels: "service=postgres"
|
|
|
|
# ============================================
|
|
# AnythingLLM Application
|
|
# ============================================
|
|
anythingllm:
|
|
image: mintplexlabs/anythingllm:latest
|
|
container_name: anythingllm
|
|
restart: unless-stopped
|
|
cap_add:
|
|
- SYS_ADMIN
|
|
environment:
|
|
# Server Configuration
|
|
SERVER_PORT: 3001
|
|
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is required}
|
|
SIG_KEY: ${SIG_KEY:?SIG_KEY is required}
|
|
SIG_SALT: ${SIG_SALT:?SIG_SALT is required}
|
|
STORAGE_DIR: /app/server/storage
|
|
|
|
# PostgreSQL Configuration
|
|
VECTOR_DB: "pgvector"
|
|
PGVECTOR_CONNECTION_STRING: "postgresql://${POSTGRES_USER:-anythingllm}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-anythingllm}"
|
|
|
|
# LLM Provider - Generic OpenAI (for llama-cpp)
|
|
LLM_PROVIDER: "generic-openai"
|
|
GENERIC_OPEN_AI_BASE_PATH: ${LLAMACPP_BASE_URL:?LLAMACPP_BASE_URL is required}
|
|
GENERIC_OPEN_AI_MODEL_PREF: ${LLAMACPP_MODEL:-llama-3-8b}
|
|
GENERIC_OPEN_AI_MODEL_TOKEN_LIMIT: ${LLAMACPP_TOKEN_LIMIT:-8192}
|
|
GENERIC_OPEN_AI_API_KEY: ${LLAMACPP_API_KEY:-not-needed}
|
|
|
|
# AWS Bedrock Configuration (optional - uncomment if using)
|
|
# LLM_PROVIDER: "bedrock"
|
|
# AWS_BEDROCK_LLM_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
|
|
# AWS_BEDROCK_LLM_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
|
|
# AWS_BEDROCK_LLM_REGION: ${AWS_REGION:-us-east-1}
|
|
# AWS_BEDROCK_LLM_MODEL_PREFERENCE: ${BEDROCK_MODEL:-anthropic.claude-3-sonnet-20240229-v1:0}
|
|
# AWS_BEDROCK_LLM_MODEL_TOKEN_LIMIT: 200000
|
|
|
|
# Embedding Configuration
|
|
EMBEDDING_ENGINE: ${EMBEDDING_ENGINE}
|
|
EMBEDDING_MODEL_PREF: ${EMBEDDING_MODEL_PREF}
|
|
EMBEDDING_MODEL_MAX_CHUNK_LENGTH: ${EMBEDDING_MODEL_MAX_CHUNK_LENGTH}
|
|
EMBEDDING_BASE_PATH: ${EMBEDDING_BASE_PATH}
|
|
GENERIC_OPEN_AI_EMBEDDING_API_KEY: ${GENERIC_OPEN_AI_EMBEDDING_API_KEY}
|
|
GENERIC_OPEN_AI_EMBEDDING_MAX_CONCURRENT_CHUNKS: ${GENERIC_OPEN_AI_EMBEDDING_MAX_CONCURRENT_CHUNKS}
|
|
GENERIC_OPEN_AI_EMBEDDING_API_DELAY_MS: ${GENERIC_OPEN_AI_EMBEDDING_API_DELAY_MS}
|
|
|
|
# Whisper Configuration
|
|
WHISPER_PROVIDER: "local"
|
|
|
|
# TTS Configuration
|
|
TTS_PROVIDER: "native"
|
|
|
|
# Security
|
|
DISABLE_TELEMETRY: "true"
|
|
|
|
# Logging (JSON format for Loki)
|
|
NODE_ENV: production
|
|
|
|
# Optional: Enable HTTP logging
|
|
# ENABLE_HTTP_LOGGER: "true"
|
|
# ENABLE_HTTP_LOGGER_TIMESTAMPS: "true"
|
|
volumes:
|
|
- anythingllm_data:/app/server/storage
|
|
- anythingllm_data:/app/collector/hotdir
|
|
- anythingllm_data:/app/collector/outputs
|
|
networks:
|
|
- frontend
|
|
- backend
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/api/ping"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 4G
|
|
reservations:
|
|
memory: 2G
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "50m"
|
|
max-file: "5"
|
|
labels: "service=anythingllm"
|
|
|
|
# ============================================
|
|
# HAProxy - Reverse Proxy & Load Balancer
|
|
# ============================================
|
|
haproxy:
|
|
image: haproxy:2.9-alpine
|
|
container_name: anythingllm-haproxy
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
- "8404:8404" # HAProxy stats
|
|
volumes:
|
|
- ./haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
|
|
- ./haproxy/certs:/etc/haproxy/certs:ro
|
|
- ./haproxy/errors:/etc/haproxy/errors:ro
|
|
networks:
|
|
- frontend
|
|
- monitoring
|
|
depends_on:
|
|
- anythingllm
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8404/stats"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512M
|
|
reservations:
|
|
memory: 256M
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
labels: "service=haproxy"
|
|
|
|
# ============================================
|
|
# Prometheus - Metrics Collection
|
|
# ============================================
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: anythingllm-prometheus
|
|
restart: unless-stopped
|
|
command:
|
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
- '--storage.tsdb.path=/prometheus'
|
|
- '--storage.tsdb.retention.time=30d'
|
|
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
|
|
- '--web.console.templates=/usr/share/prometheus/consoles'
|
|
- '--web.enable-lifecycle'
|
|
volumes:
|
|
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- ./prometheus/alerts.yml:/etc/prometheus/alerts.yml:ro
|
|
- prometheus_data:/prometheus
|
|
networks:
|
|
- monitoring
|
|
- backend
|
|
ports:
|
|
- "9090:9090"
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9090/-/healthy"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 2G
|
|
reservations:
|
|
memory: 1G
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
labels: "service=prometheus"
|
|
|
|
# ============================================
|
|
# Postgres Exporter - Database Metrics
|
|
# ============================================
|
|
postgres-exporter:
|
|
image: prometheuscommunity/postgres-exporter:latest
|
|
container_name: anythingllm-postgres-exporter
|
|
restart: unless-stopped
|
|
environment:
|
|
DATA_SOURCE_NAME: "postgresql://${POSTGRES_USER:-anythingllm}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-anythingllm}?sslmode=disable"
|
|
networks:
|
|
- backend
|
|
- monitoring
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 256M
|
|
reservations:
|
|
memory: 128M
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "5m"
|
|
max-file: "2"
|
|
labels: "service=postgres-exporter"
|
|
|
|
# ============================================
|
|
# cAdvisor - Container Metrics
|
|
# ============================================
|
|
cadvisor:
|
|
image: gcr.io/cadvisor/cadvisor:latest
|
|
container_name: anythingllm-cadvisor
|
|
restart: unless-stopped
|
|
privileged: true
|
|
volumes:
|
|
- /:/rootfs:ro
|
|
- /var/run:/var/run:ro
|
|
- /sys:/sys:ro
|
|
- /var/lib/docker/:/var/lib/docker:ro
|
|
- /dev/disk/:/dev/disk:ro
|
|
networks:
|
|
- monitoring
|
|
ports:
|
|
- "8080:8080"
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512M
|
|
reservations:
|
|
memory: 256M
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "5m"
|
|
max-file: "2"
|
|
labels: "service=cadvisor"
|
|
|
|
# ============================================
|
|
# Loki - Log Aggregation
|
|
# ============================================
|
|
loki:
|
|
image: grafana/loki:latest
|
|
container_name: anythingllm-loki
|
|
restart: unless-stopped
|
|
command: -config.file=/etc/loki/loki-config.yml
|
|
volumes:
|
|
- ./loki/loki-config.yml:/etc/loki/loki-config.yml:ro
|
|
- loki_data:/loki
|
|
networks:
|
|
- monitoring
|
|
ports:
|
|
- "3100:3100"
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3100/ready"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 2G
|
|
reservations:
|
|
memory: 1G
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
labels: "service=loki"
|
|
|
|
# ============================================
|
|
# Grafana Alloy - Log Collection
|
|
# ============================================
|
|
alloy:
|
|
image: grafana/alloy:latest
|
|
container_name: anythingllm-alloy
|
|
restart: unless-stopped
|
|
command:
|
|
- run
|
|
- /etc/alloy/config.alloy
|
|
- --server.http.listen-addr=0.0.0.0:12345
|
|
- --storage.path=/var/lib/alloy/data
|
|
volumes:
|
|
- ./alloy/config.alloy:/etc/alloy/config.alloy:ro
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
- /var/lib/docker/containers:/var/lib/docker/containers:ro
|
|
networks:
|
|
- monitoring
|
|
ports:
|
|
- "12345:12345"
|
|
depends_on:
|
|
- loki
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512M
|
|
reservations:
|
|
memory: 256M
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
labels: "service=alloy"
|
|
|
|
# ============================================
|
|
# Grafana - Visualization Dashboard
|
|
# ============================================
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: anythingllm-grafana
|
|
restart: unless-stopped
|
|
environment:
|
|
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
|
|
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:?GRAFANA_ADMIN_PASSWORD is required}
|
|
GF_INSTALL_PLUGINS: grafana-clock-panel,grafana-simple-json-datasource
|
|
GF_SERVER_ROOT_URL: ${GRAFANA_ROOT_URL:-http://localhost:3000}
|
|
GF_USERS_ALLOW_SIGN_UP: "false"
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
- ./grafana/provisioning:/etc/grafana/provisioning:ro
|
|
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
|
|
networks:
|
|
- monitoring
|
|
- frontend
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
- prometheus
|
|
- loki
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 1G
|
|
reservations:
|
|
memory: 512M
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
labels: "service=grafana"
|