services:
  postgres:
    image: postgres:16-alpine
    container_name: sub2api-test-postgres
    environment:
      POSTGRES_USER: sub2api
      POSTGRES_PASSWORD: sub2api
      POSTGRES_DB: sub2api
    ports:
      - "127.0.0.1:5432:5432"
    volumes:
      - ./postgres_test_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U sub2api -d sub2api"]
      interval: 5s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    container_name: sub2api-test-redis
    ports:
      - "127.0.0.1:6379:6379"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 5s
      retries: 5
