version: '3' services: mysql1: container_name: mysql1 command: --default-authentication-plugin=mysql_native_password image: "mysql" ports: - "3307:3307" volumes: - ./master.cnf:/etc/mysql/conf.d/mysql.conf.cnf environment: - MYSQL_ROOT_PASSWORD=mysql1 - MYSQL_TCP_PORT=3307 - MYSQL_USER=monitoruser - MYSQL_PASSWORD=monitorpass - MYSQL_DATABASE=application mysql2: container_name: mysql2 image: "mysql" ports: - "3308:3308" volumes: - ./replica.cnf:/etc/mysql/conf.d/mysql.conf.cnf environment: - MYSQL_ROOT_PASSWORD=mysql2 - MYSQL_TCP_PORT=3308 - MYSQL_USER=monitoruser - MYSQL_PASSWORD=monitorpass - MYSQL_DATABASE=application links: - "mysql1:mysql1" mysqlproxy: container_name: mysqlproxy image: "proxysql/proxysql" volumes: - ./proxysql.cnf:/etc/proxysql.cnf links: - "mysql1:mysql1" - "mysql2:mysql2" ports: - "16032:6032" - "16033:6033" - "16070:6070"