# Testing Docker Compose configuration for testing.dk0.dev # Runs alongside production with isolated DB/Redis and different ports. services: portfolio-testing: image: portfolio-app:testing container_name: portfolio-app-testing restart: unless-stopped ports: - "3002:3000" # Nginx Proxy Manager -> http://HOST:3002 environment: - NODE_ENV=production - DATABASE_URL=postgresql://portfolio_user:portfolio_testing_pass@postgres-testing:5432/portfolio_testing_db?schema=public - REDIS_URL=redis://redis-testing:6379 - NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL:-https://testing.dk0.dev} - MY_EMAIL=${MY_EMAIL:-contact@dk0.dev} - MY_INFO_EMAIL=${MY_INFO_EMAIL:-info@dk0.dev} - MY_PASSWORD=${MY_PASSWORD} - MY_INFO_PASSWORD=${MY_INFO_PASSWORD} - ADMIN_BASIC_AUTH=${ADMIN_BASIC_AUTH:-admin:testing_password} - ADMIN_SESSION_SECRET=${ADMIN_SESSION_SECRET} - PRISMA_AUTO_BASELINE=${PRISMA_AUTO_BASELINE:-false} - LOG_LEVEL=info - N8N_WEBHOOK_URL=${N8N_WEBHOOK_URL:-} - N8N_SECRET_TOKEN=${N8N_SECRET_TOKEN:-} - N8N_API_KEY=${N8N_API_KEY:-} volumes: - portfolio_testing_data:/app/.next/cache networks: - portfolio_testing_net - proxy depends_on: postgres-testing: condition: service_healthy redis-testing: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s postgres-testing: image: postgres:16-alpine container_name: portfolio-postgres-testing restart: unless-stopped environment: - POSTGRES_DB=portfolio_testing_db - POSTGRES_USER=portfolio_user - POSTGRES_PASSWORD=portfolio_testing_pass volumes: - postgres_testing_data:/var/lib/postgresql/data - ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro networks: - portfolio_testing_net ports: - "5435:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U portfolio_user -d portfolio_testing_db"] interval: 10s timeout: 5s retries: 5 start_period: 30s redis-testing: image: redis:7-alpine container_name: portfolio-redis-testing restart: unless-stopped command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru volumes: - redis_testing_data:/data networks: - portfolio_testing_net ports: - "6382:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 start_period: 30s volumes: portfolio_testing_data: driver: local postgres_testing_data: driver: local redis_testing_data: driver: local networks: portfolio_testing_net: driver: bridge proxy: external: true