services:
  mysql:
    image: mysql:8.4
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: coffee_manager
      MYSQL_USER: coffee_manager
      MYSQL_PASSWORD: coffee_manager
      MYSQL_ROOT_PASSWORD: local-root-password
    ports:
      - "3306:3306"
    volumes:
      - coffee_manager_mysql:/var/lib/mysql
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
      interval: 5s
      timeout: 5s
      retries: 20

volumes:
  coffee_manager_mysql:
