# Local MySQL for AquaERP development and E2E tests.
# Usage:
#   docker compose up -d
#   npm run db:setup
#   npm run db:seed:demo

services:
  mysql:
    image: mysql:8.0
    container_name: aquaerp-mysql
    restart: unless-stopped
    ports:
      - '3306:3306'
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: aquaerp_operating
    command: >
      --character-set-server=utf8mb4
      --collation-server=utf8mb4_unicode_ci
      --default-authentication-plugin=mysql_native_password
    volumes:
      - aquaerp_mysql_data:/var/lib/mysql
    healthcheck:
      test: ['CMD', 'mysqladmin', 'ping', '-h', '127.0.0.1', '-uroot', '-proot']
      interval: 5s
      timeout: 5s
      retries: 30
      start_period: 20s

volumes:
  aquaerp_mysql_data:
