version: '3.8' services: # Test Database test-postgres: image: postgres:15 environment: POSTGRES_DB: meteor_test POSTGRES_USER: meteor_test POSTGRES_PASSWORD: meteor_test_pass ports: - "5433:5432" volumes: - test_postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U meteor_test -d meteor_test"] interval: 5s timeout: 5s retries: 5 # LocalStack for AWS services (S3, SQS) localstack: image: localstack/localstack:3.0 ports: - "4566:4566" - "4510-4559:4510-4559" environment: - SERVICES=s3,sqs - DEBUG=1 - DOCKER_HOST=unix:///var/run/docker.sock - LOCALSTACK_HOSTNAME=localhost volumes: - "/var/run/docker.sock:/var/run/docker.sock" - "./test-data/localstack:/tmp/localstack" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:4566/_localstack/health"] interval: 10s timeout: 5s retries: 3 # Backend for integration tests test-backend: build: context: ./meteor-web-backend dockerfile: Dockerfile environment: - NODE_ENV=test - DATABASE_URL=postgresql://meteor_test:meteor_test_pass@test-postgres:5432/meteor_test - JWT_SECRET=test-jwt-secret-key-for-integration-tests - AWS_ENDPOINT_URL=http://localstack:4566 - AWS_ACCESS_KEY_ID=test - AWS_SECRET_ACCESS_KEY=test - AWS_REGION=us-east-1 - S3_BUCKET_NAME=meteor-test-bucket - SQS_QUEUE_URL=http://localstack:4566/000000000000/meteor-processing-queue - PORT=3000 ports: - "3000:3000" depends_on: test-postgres: condition: service_healthy localstack: condition: service_healthy command: > sh -c " npm run migrate:up && npm run start:prod " healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/api/v1/events/health/check"] interval: 10s timeout: 5s retries: 5 # Frontend for E2E tests test-frontend: build: context: ./meteor-frontend dockerfile: Dockerfile environment: - NEXT_PUBLIC_API_URL=http://test-backend:3000 - NODE_ENV=test ports: - "3001:3000" depends_on: test-backend: condition: service_healthy volumes: test_postgres_data: