# BloxServer Development Docker Compose # Run with: docker-compose up -d version: '3.8' services: # ========================================================================== # PostgreSQL Database # ========================================================================== postgres: image: postgres:16-alpine container_name: bloxserver-postgres environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: bloxserver ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 # ========================================================================== # Redis (for caching, rate limiting, queues) # ========================================================================== redis: image: redis:7-alpine container_name: bloxserver-redis ports: - "6379:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 # ========================================================================== # BloxServer API # ========================================================================== api: build: context: . dockerfile: Dockerfile container_name: bloxserver-api ports: - "8000:8000" environment: - ENV=development - DATABASE_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/bloxserver - REDIS_URL=redis://redis:6379 - AUTO_CREATE_TABLES=true - ENABLE_DOCS=true - CORS_ORIGINS=http://localhost:3000 depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: # Mount source for hot reload in development - .:/app/bloxserver:ro command: uvicorn bloxserver.api.main:app --host 0.0.0.0 --port 8000 --reload volumes: postgres_data: redis_data: