services:
  postgres:
    image: postgres:16-alpine
    container_name: ballbox-postgres
    restart: unless-stopped
    environment:
      POSTGRES_DB: ballbox_local
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    ports:
      - "5432:5432"
    volumes:
      - ballbox_postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d ballbox_local"]
      interval: 5s
      timeout: 5s
      retries: 10

volumes:
  ballbox_postgres_data:
