services:
  mysql:
    image: mysql:8.4
    container_name: roasted-dry-food-db
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: roasted_dry_food
      MYSQL_USER: landing
      MYSQL_PASSWORD: landing_secret
      MYSQL_ROOT_PASSWORD: root_secret
    ports:
      - "3307:3306"
    volumes:
      - mysql-data:/var/lib/mysql
      - ./docker/mysql/init:/docker-entrypoint-initdb.d:ro
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot_secret"]
      interval: 5s
      timeout: 5s
      retries: 20

volumes:
  mysql-data:
