services:
#  app:
#    build: .
#    ports:
#      - "8005:8005"
#    env_file: .env
#    depends_on:
#      postgres:
#        condition: service_healthy
#      redis:
#        condition: service_healthy

  postgres:
    image: postgres:17-alpine
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-resonance}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-resonance}
      POSTGRES_DB: ${POSTGRES_DB:-resonance}
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-resonance}"]
      interval: 5s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 5s
      retries: 5

volumes:
  postgres_data:
  redis_data:
