services:
  postgres:
    image: postgres:18.4-alpine
    environment:
      POSTGRES_DB: travel_planner
      POSTGRES_USER: travel_planner
      POSTGRES_PASSWORD: travel_planner_dev
    ports:
      - "127.0.0.1:5432:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U travel_planner -d travel_planner"]
      interval: 2s
      timeout: 3s
      retries: 20
    volumes:
      - travel_postgres_dev:/var/lib/postgresql

  redis:
    image: redis:8.8.1-alpine
    ports:
      - "127.0.0.1:6379:6379"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 2s
      timeout: 3s
      retries: 20

volumes:
  travel_postgres_dev:
