services:
  postgres:
    image: postgres:16-alpine
    container_name: bmm-postgres
    environment:
      POSTGRES_USER: bmm
      POSTGRES_PASSWORD: bmm
      POSTGRES_DB: bmm
    ports:
      - "5440:5432"
    volumes:
      - bmm_pg:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U bmm -d bmm"]
      interval: 3s
      timeout: 3s
      retries: 20

  redis:
    image: redis:7-alpine
    container_name: bmm-redis
    ports:
      - "6390:6379"
    volumes:
      - bmm_redis:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 3s
      timeout: 3s
      retries: 20

volumes:
  bmm_pg:
  bmm_redis:
