常见应用的docker-compose.yml配置

发布时间 2023-08-17 14:14:58作者: 李白端了一碗汤

MYSQL

version: "3"
services:
  db:
    image: mysql:5.7.35
    privileged: true
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: CREC_2021
      TZ: Asia/Shanghai
    command:
      --lower_case_table_names=1
      --max_connections=1000
      --character-set-server=utf8mb4
      --collation-server=utf8mb4_general_ci
      --wait_timeout=31536000
      --interactive_timeout=31536000
      --default-authentication-plugin=mysql_native_password
      --max_allowed_packet=100M
      --transaction-isolation=READ-COMMITTED
      --sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    ports:
      - 3306:3306
    volumes:
      - ./db:/var/lib/mysql