84 lines
2.1 KiB
YAML
84 lines
2.1 KiB
YAML
services:
|
|
postgres:
|
|
image: pgvector/pgvector:0.8.7-pg17
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\""]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
container_name: postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${DATABASE_USER}
|
|
POSTGRES_PASSWORD: ${DATABASE_PASS}
|
|
POSTGRES_DB: ${DATABASE_NAME}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
redis:
|
|
image: redis:8-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
REDISCLI_AUTH: ${REDIS_PASSWORD}
|
|
command: ["sh", "-c", "exec redis-server --appendonly yes --requirepass \"$$REDISCLI_AUTH\""]
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
volumes:
|
|
- redis_data:/data
|
|
|
|
embedding:
|
|
profiles: ["rag"]
|
|
build: ./embedding-service
|
|
restart: unless-stopped
|
|
environment:
|
|
RAG_EMBEDDING_MODEL: ${RAG_EMBEDDING_MODEL:-intfloat/multilingual-e5-small}
|
|
RAG_EMBEDDING_REVISION: ${RAG_EMBEDDING_REVISION:-62ff60abe92eb88c1b297fabaad28f7ac77b5875}
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health', timeout=3)"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 4
|
|
start_period: 3m
|
|
volumes:
|
|
- embedding_cache:/cache
|
|
networks:
|
|
- embedding_network
|
|
cpus: 2
|
|
mem_limit: 2g
|
|
|
|
app:
|
|
build: .
|
|
container_name: nest-app
|
|
restart: unless-stopped
|
|
stop_grace_period: 2m
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
environment:
|
|
NODE_ENV: production
|
|
RAG_EMBEDDING_URL: http://embedding:8080
|
|
RAG_STORAGE_DIR: /var/lib/heala/articles
|
|
env_file:
|
|
- ${APP_ENV_FILE:-.env.production}
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- article_files:/var/lib/heala/articles
|
|
networks:
|
|
- default
|
|
- embedding_network
|
|
|
|
networks:
|
|
embedding_network:
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
embedding_cache:
|
|
article_files:
|