knowledge-assistant-backend / docker-compose.prod.yml
AnuragShirke's picture
Add deployment changes for hosting
edd9bd7
services:
frontend:
build:
context: ./rag-quest-hub
dockerfile: Dockerfile
ports:
- "3000:8080"
depends_on:
- backend
environment:
- VITE_API_BASE_URL=${VITE_API_BASE_URL:-http://localhost:8000}
- VITE_API_TIMEOUT=${VITE_API_TIMEOUT:-30000}
- VITE_ENABLE_REGISTRATION=${VITE_ENABLE_REGISTRATION:-true}
restart: unless-stopped
networks:
- app-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
backend:
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
volumes:
- db_data:/app/data
depends_on:
qdrant:
condition: service_healthy
environment:
- QDRANT_HOST=qdrant
- QDRANT_PORT=6333
- GEMINI_API_KEY=${GEMINI_API_KEY}
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:3000}
- DATABASE_URL=sqlite+aiosqlite:///./data/knowledge_assistant.db
- JWT_SECRET=${JWT_SECRET}
- JWT_LIFETIME_SECONDS=${JWT_LIFETIME_SECONDS:-3600}
- USER_REGISTRATION_ENABLED=${USER_REGISTRATION_ENABLED:-true}
- EMAIL_VERIFICATION_REQUIRED=${EMAIL_VERIFICATION_REQUIRED:-false}
- PYTHONUNBUFFERED=1
- PYTHONDONTWRITEBYTECODE=1
restart: unless-stopped
networks:
- app-network
entrypoint: ["/app/scripts/wait-for-qdrant.sh", "qdrant:6333", "/app/scripts/init-db.sh"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
qdrant:
image: qdrant/qdrant:latest
ports:
- "6333:6333"
- "6334:6334"
volumes:
- qdrant_data:/qdrant/storage
environment:
- QDRANT__SERVICE__HTTP_PORT=6333
- QDRANT__SERVICE__GRPC_PORT=6334
restart: unless-stopped
networks:
- app-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:6333/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
volumes:
qdrant_data:
driver: local
db_data:
driver: local
networks:
app-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16