services:
  mysql:
    image: mysql:8.4
    container_name: gaming305-mysql
    restart: unless-stopped
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: rootpassword
      MYSQL_DATABASE: 305gaming
      MYSQL_USER: gaming305
      MYSQL_PASSWORD: gaming305pass
    volumes:
      - mysql_data:/var/lib/mysql
    command:
      - --default-authentication-plugin=caching_sha2_password
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-prootpassword"]
      interval: 10s
      timeout: 5s
      retries: 10

volumes:
  mysql_data:
