Настройки развертывания

This commit is contained in:
2026-01-30 22:53:16 +03:00
parent e899f54f04
commit 5ce6335ad8
6 changed files with 141 additions and 7 deletions

56
docker-compose.yml Normal file
View File

@@ -0,0 +1,56 @@
# Postgres with pgvector + RAG Agent app (from repo git@git.lesha.spb.ru:alex/RagAgent.git).
# Clone the repo, then: docker compose up -d
# App and DB share network "rag_net"; app uses RAG_DB_DSN with host=postgres.
# DB init: scripts in docker/postgres-init/ run on first start (empty volume); to disable, comment out the init volume.
services:
postgres:
image: pgvector/pgvector:pg16
container_name: rag-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-rag}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-rag_secret}
POSTGRES_DB: ${POSTGRES_DB:-rag}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- rag_pgdata:/var/lib/postgresql/data
# Init scripts run once on first start (create extension, tables). Optional: comment out to skip.
- ./docker/postgres-init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-rag} -d ${POSTGRES_DB:-rag}"]
interval: 5s
timeout: 5s
retries: 5
networks:
- rag_net
app:
build:
context: .
dockerfile: Dockerfile
image: rag-agent:latest
container_name: rag-agent
restart: "no"
depends_on:
postgres:
condition: service_healthy
environment:
RAG_DB_DSN: "postgresql://${POSTGRES_USER:-rag}:${POSTGRES_PASSWORD:-rag_secret}@postgres:5432/${POSTGRES_DB:-rag}"
RAG_REPO_PATH: ${RAG_REPO_PATH:-/data}
RAG_EMBEDDINGS_DIM: ${RAG_EMBEDDINGS_DIM:-1536}
GIGACHAT_CREDENTIALS: ${GIGACHAT_CREDENTIALS:-}
GIGACHAT_EMBEDDINGS_MODEL: ${GIGACHAT_EMBEDDINGS_MODEL:-Embeddings}
volumes:
- ${RAG_REPO_PATH:-./data}:/data:ro
entrypoint: ["rag-agent"]
command: ["ask", "--help"]
networks:
- rag_net
networks:
rag_net:
driver: bridge
volumes:
rag_pgdata: