Files
ai-rpg/docker-compose.yml

77 lines
2.1 KiB
YAML
Raw Permalink Normal View History

2026-06-19 11:28:04 +03:00
services:
2026-06-20 19:13:05 +03:00
db:
image: postgres:15-alpine
2026-06-19 11:28:04 +03:00
environment:
POSTGRES_USER: ${POSTGRES_USER:-airpg}
2026-06-20 19:13:05 +03:00
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-airpg}
POSTGRES_DB: ${POSTGRES_DB:-airpg}
2026-06-19 11:28:04 +03:00
volumes:
2026-06-20 19:13:05 +03:00
- pg_data:/var/lib/postgresql/data
2026-06-19 11:28:04 +03:00
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-airpg}"]
interval: 5s
timeout: 3s
retries: 10
qdrant:
2026-06-20 19:13:05 +03:00
image: qdrant/qdrant:v1.9.0
environment:
QDRANT__LOG_LEVEL: INFO
volumes:
- qdrant_data:/qdrant/storage
2026-06-19 11:28:04 +03:00
ports:
- "6333:6333"
- "6334:6334"
2026-06-20 19:13:05 +03:00
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/6333 && echo -e 'GET /collections HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && head -n 1 <&3 | grep -q 200"]
interval: 10s
timeout: 5s
retries: 10
2026-06-19 11:28:04 +03:00
backend:
build:
2026-06-20 19:13:05 +03:00
context: .
dockerfile: deploy/Dockerfile.backend
env_file:
- .env
2026-06-19 11:28:04 +03:00
environment:
2026-06-20 22:21:47 +03:00
# Override .env values with docker-compose service names
2026-06-20 19:13:05 +03:00
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-airpg}:${POSTGRES_PASSWORD:-airpg}@db:5432/${POSTGRES_DB:-airpg}
2026-06-19 11:28:04 +03:00
QDRANT_URL: http://qdrant:6333
2026-06-20 22:21:47 +03:00
# Allow backend to reach host services (e.g. Ollama on host) via host.docker.internal
# On Linux this requires the extra_hosts mapping below.
extra_hosts:
- "host.docker.internal:host-gateway"
2026-06-20 19:13:05 +03:00
volumes:
- ./data:/app/data
- ./app:/app/app
2026-06-19 11:28:04 +03:00
ports:
- "8000:8000"
depends_on:
2026-06-20 19:13:05 +03:00
db:
2026-06-19 11:28:04 +03:00
condition: service_healthy
qdrant:
2026-06-19 11:30:38 +03:00
condition: service_healthy
2026-06-19 11:28:04 +03:00
frontend:
2026-06-20 22:21:47 +03:00
# nginx-served production build of the React app.
# Listens on container port 80, mapped to host port 8080.
# Access the app at http://localhost:8080
2026-06-19 11:28:04 +03:00
build:
2026-06-20 22:21:47 +03:00
context: .
dockerfile: deploy/Dockerfile.frontend
args:
# Bake the API base URL into the bundle at build time.
# Relative "/api" works because nginx proxies /api/* → backend:8000.
VITE_API_BASE_URL: /api
2026-06-19 11:28:04 +03:00
ports:
2026-06-20 22:21:47 +03:00
- "8080:80"
2026-06-20 19:13:05 +03:00
depends_on:
- backend
2026-06-19 11:28:04 +03:00
volumes:
2026-06-20 19:13:05 +03:00
pg_data:
qdrant_data: