# MySQL 服务（业务主库，后续启用；先建编排）
services:
  mysql:
    image: mysql:8
    container_name: opc-mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root_pass}
      MYSQL_DATABASE: opc
      MYSQL_USER: opc
      MYSQL_PASSWORD: ${MYSQL_PASSWORD:-opc_pass}
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    ports:
      - "127.0.0.1:3306:3306"
    volumes:
      - ../../serverdata/mysql-data:/var/lib/mysql
    networks:
      - opc-network

networks:
  opc-network:
    name: opc-network
    external: true
