github.com/ecodeclub/eorm@v0.0.2-0.20231001112437-dae71da914d0/script/integration_test_compose.yml (about) 1 # Copyright 2021 ecodeclub 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 version: "3.0" 16 services: 17 mysql8: 18 image: mysql:8.0.29 19 restart: always 20 command: --default-authentication-plugin=mysql_native_password 21 environment: 22 MYSQL_ROOT_PASSWORD: root 23 volumes: 24 - ./mysql/init.sql:/docker-entrypoint-initdb.d/init.sql 25 ports: 26 - "13306:3306" 27 master: 28 image: mysql:8.0.29 29 ports: 30 - '13307:3306' 31 restart: always 32 hostname: mysql-master 33 environment: 34 MYSQL_ROOT_PASSWORD: root 35 MASTER_SYNC_USER: "sync" 36 MASTER_SYNC_PASSWORD: "123456" 37 ADMIN_USER: "root" 38 ADMIN_PASSWORD: "root" 39 command: 40 - "--server-id=1" 41 - "--character-set-server=utf8mb4" 42 - "--collation-server=utf8mb4_unicode_ci" 43 - "--log-bin=mysql-bin" 44 - "--sync_binlog=1" 45 - "--binlog-ignore-db=mysql" 46 - "--binlog-ignore-db=sys" 47 - "--binlog-ignore-db=performance_schema" 48 - "--binlog-ignore-db=information_schema" 49 - "--sql_mode=NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,PIPES_AS_CONCAT,ANSI_QUOTES" 50 volumes: 51 - ./mysql/master:/docker-entrypoint-initdb.d/ 52 - ./mysql/init.sql:/docker-entrypoint-initdb.d/init.sql 53 slave: 54 image: mysql:8.0.29 55 container_name: mysql-slave 56 ports: 57 - '13308:3306' 58 restart: always 59 hostname: mysql-slave 60 environment: 61 MYSQL_ROOT_PASSWORD: "root" 62 SLAVE_SYNC_USER: "sync" 63 SLAVE_SYNC_PASSWORD: "123456" 64 ADMIN_USER: "root" 65 ADMIN_PASSWORD: "root" 66 MASTER_HOST: "mysql-master" 67 command: 68 - "--server-id=2" 69 - "--character-set-server=utf8mb4" 70 - "--collation-server=utf8mb4_unicode_ci" 71 - "--sql_mode=NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,PIPES_AS_CONCAT,ANSI_QUOTES" 72 volumes: 73 - ./mysql/slave:/docker-entrypoint-initdb.d/ 74 - ./mysql/init.sql:/docker-entrypoint-initdb.d/init.sql 75 # mysql5: 76 # image: mysql:5.7.38 77 # restart: always 78 # environment: 79 # MYSQL_ROOT_PASSWORD: root 80 # volumes: 81 # - ./init.sql:/script/sql/mysql.sh 82 # ports: 83 # - "13307:3306" 84