Spaces:
Running
Running
| # R-135: Removed deprecated version key (Docker Compose v2+ ignores it) | |
| # Author RAG Chatbot SaaS β Docker Compose (Development) | |
| # Usage: docker-compose up -d | |
| # Services: postgres, redis, chromadb, celery worker, flower | |
| services: | |
| # ββ PostgreSQL ββββββββββββββββββββββββββββββββββββββββββ | |
| postgres: | |
| image: postgres:16-alpine | |
| container_name: authorbot_postgres | |
| environment: | |
| POSTGRES_DB: authorbot | |
| POSTGRES_USER: authorbot | |
| POSTGRES_PASSWORD: authorbot_dev_password | |
| ports: | |
| - "5432:5432" | |
| volumes: | |
| - postgres_data:/var/lib/postgresql/data | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U authorbot -d authorbot"] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 5 | |
| # ββ Redis βββββββββββββββββββββββββββββββββββββββββββββββ | |
| redis: | |
| image: redis:7-alpine | |
| container_name: authorbot_redis | |
| command: redis-server --appendonly yes | |
| ports: | |
| - "6379:6379" | |
| volumes: | |
| - redis_data:/data | |
| healthcheck: | |
| test: ["CMD", "redis-cli", "ping"] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 5 | |
| # ββ ChromaDB ββββββββββββββββββββββββββββββββββββββββββββ | |
| chromadb: | |
| image: chromadb/chroma:latest | |
| container_name: authorbot_chroma | |
| ports: | |
| - "8000:8000" | |
| volumes: | |
| - chroma_data:/chroma/chroma | |
| environment: | |
| IS_PERSISTENT: "TRUE" | |
| ANONYMIZED_TELEMETRY: "FALSE" | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/heartbeat"] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 5 | |
| # ββ FastAPI Backend βββββββββββββββββββββββββββββββββββββ | |
| api: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| container_name: authorbot_api | |
| env_file: .env | |
| ports: | |
| - "8080:8080" | |
| volumes: | |
| - .:/app | |
| - upload_data:/app/uploads | |
| - geoip_data:/app/geoip | |
| depends_on: | |
| postgres: | |
| condition: service_healthy | |
| redis: | |
| condition: service_healthy | |
| chromadb: | |
| condition: service_healthy | |
| command: uvicorn app.main:app --host 0.0.0.0 --port 8080 --reload | |
| # ββ Celery Worker βββββββββββββββββββββββββββββββββββββββ | |
| celery_worker: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| container_name: authorbot_celery | |
| env_file: .env | |
| volumes: | |
| - .:/app | |
| - upload_data:/app/uploads | |
| - geoip_data:/app/geoip | |
| depends_on: | |
| postgres: | |
| condition: service_healthy | |
| redis: | |
| condition: service_healthy | |
| command: celery -A app.tasks.celery_app worker --loglevel=info --concurrency=4 | |
| # ββ Celery Beat (Scheduled Tasks) βββββββββββββββββββββββ | |
| celery_beat: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| container_name: authorbot_beat | |
| env_file: .env | |
| volumes: | |
| - .:/app | |
| depends_on: | |
| - redis | |
| command: celery -A app.tasks.celery_app beat --loglevel=info | |
| # ββ Flower (Celery Monitor) βββββββββββββββββββββββββββββ | |
| flower: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| container_name: authorbot_flower | |
| env_file: .env | |
| ports: | |
| - "5555:5555" | |
| depends_on: | |
| - redis | |
| command: celery -A app.tasks.celery_app flower --port=5555 --basic-auth=admin:${FLOWER_PASSWORD:-changeme} | |
| volumes: | |
| postgres_data: | |
| redis_data: | |
| chroma_data: | |
| upload_data: | |
| geoip_data: | |