# ================================================================ # TESTING DOCKER COMPOSE FILE # docker-compose.test.yml # ================================================================ version: '3.8' # Testing-specific configuration # Usage: docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d services: # Test database services (separate from development/production) test-auth-db: image: postgres:15-alpine environment: - POSTGRES_DB=test_auth_db - POSTGRES_USER=test_user - POSTGRES_PASSWORD=test_pass tmpfs: - /var/lib/postgresql/data # Use tmpfs for faster tests test-training-db: image: postgres:15-alpine environment: - POSTGRES_DB=test_training_db - POSTGRES_USER=test_user - POSTGRES_PASSWORD=test_pass tmpfs: - /var/lib/postgresql/data test-forecasting-db: image: postgres:15-alpine environment: - POSTGRES_DB=test_forecasting_db - POSTGRES_USER=test_user - POSTGRES_PASSWORD=test_pass tmpfs: - /var/lib/postgresql/data test-data-db: image: postgres:15-alpine environment: - POSTGRES_DB=test_data_db - POSTGRES_USER=test_user - POSTGRES_PASSWORD=test_pass tmpfs: - /var/lib/postgresql/data test-tenant-db: image: postgres:15-alpine environment: - POSTGRES_DB=test_tenant_db - POSTGRES_USER=test_user - POSTGRES_PASSWORD=test_pass tmpfs: - /var/lib/postgresql/data test-notification-db: image: postgres:15-alpine environment: - POSTGRES_DB=test_notification_db - POSTGRES_USER=test_user - POSTGRES_PASSWORD=test_pass tmpfs: - /var/lib/postgresql/data # Test Redis test-redis: image: redis:7-alpine command: redis-server --appendonly no --save "" tmpfs: - /data # Override services to use test databases auth-service: environment: - TESTING=true - DATABASE_URL=postgresql+asyncpg://test_user:test_pass@test-auth-db:5432/test_auth_db - REDIS_URL=redis://test-redis:6379 - MOCK_EXTERNAL_APIS=true depends_on: - test-auth-db - test-redis training-service: environment: - TESTING=true - DATABASE_URL=postgresql+asyncpg://test_user:test_pass@test-training-db:5432/test_training_db - REDIS_URL=redis://test-redis:6379 - MOCK_EXTERNAL_APIS=true depends_on: - test-training-db - test-redis forecasting-service: environment: - TESTING=true - DATABASE_URL=postgresql+asyncpg://test_user:test_pass@test-forecasting-db:5432/test_forecasting_db - REDIS_URL=redis://test-redis:6379 - MOCK_EXTERNAL_APIS=true depends_on: - test-forecasting-db - test-redis data-service: environment: - TESTING=true - DATABASE_URL=postgresql+asyncpg://test_user:test_pass@test-data-db:5432/test_data_db - REDIS_URL=redis://test-redis:6379 - MOCK_EXTERNAL_APIS=true depends_on: - test-data-db - test-redis tenant-service: environment: - TESTING=true - DATABASE_URL=postgresql+asyncpg://test_user:test_pass@test-tenant-db:5432/test_tenant_db - REDIS_URL=redis://test-redis:6379 - MOCK_EXTERNAL_APIS=true depends_on: - test-tenant-db - test-redis notification-service: environment: - TESTING=true - DATABASE_URL=postgresql+asyncpg://test_user:test_pass@test-notification-db:5432/test_notification_db - REDIS_URL=redis://test-redis:6379 - MOCK_EXTERNAL_APIS=true depends_on: - test-notification-db - test-redis