Spaces:
Sleeping
Sleeping
| version: "3.8" | |
| services: | |
| # 1. pgvector Database Layer (PostgreSQL 15 pre-loaded with vector support) | |
| postgres_vector: | |
| image: pgvector/pgvector:pg15 | |
| container_name: neuralvault_postgres | |
| restart: always | |
| environment: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres_secure_password | |
| POSTGRES_DB: neuralvault_db | |
| ports: | |
| - "5432:5432" | |
| volumes: | |
| - postgres_data:/var/lib/postgresql/data | |
| # Mount initial database schema script | |
| - ./backend/schema.sql:/docker-entrypoint-initdb.d/schema.sql | |
| # 2. NoSQL Logging Layer (MongoDB 6.0 for session tracing & RAG evaluations) | |
| mongo_db: | |
| image: mongo:6.0 | |
| container_name: neuralvault_mongodb | |
| restart: always | |
| ports: | |
| - "27017:27017" | |
| volumes: | |
| - mongo_data:/data/db | |
| # 3. Cache & Limiter Layer (Redis 7.0 for sliding window rate limits & result caching) | |
| redis_cache: | |
| image: redis:7.0-alpine | |
| container_name: neuralvault_redis | |
| restart: always | |
| ports: | |
| - "6379:6379" | |
| volumes: | |
| - redis_data:/data | |
| # 4. FastAPI Python Backend Service | |
| backend: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| container_name: neuralvault_backend | |
| restart: always | |
| depends_on: | |
| - postgres_vector | |
| - mongo_db | |
| - redis_cache | |
| ports: | |
| - "8000:8000" | |
| environment: | |
| # Database connection URIs | |
| DATABASE_URL: postgresql://postgres:postgres_secure_password@postgres_vector:5432/neuralvault_db | |
| MONGO_URL: mongodb://mongo_db:27017/ | |
| DB_NAME: neuralvault | |
| UPSTASH_REDIS_REST_URL: http://redis_cache:6379 | |
| UPSTASH_REDIS_REST_TOKEN: local_bypass_token | |
| # completions API keys (fill in as needed in .env override) | |
| GROQ_API_KEY: ${GROQ_API_KEY:-} | |
| # Pool variables | |
| POSTGRES_POOL_SIZE: 10 | |
| CORS_ORIGINS: "*" | |
| # 5. React Frontend Client SPA | |
| frontend: | |
| image: node:18-alpine | |
| container_name: neuralvault_frontend | |
| restart: always | |
| working_dir: /app | |
| volumes: | |
| - ./frontend:/app | |
| ports: | |
| - "3000:3000" | |
| environment: | |
| - REACT_APP_BACKEND_URL=http://localhost:8000 | |
| command: npm start | |
| volumes: | |
| postgres_data: | |
| mongo_data: | |
| redis_data: | |