docker-compose.yml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. version: '3'
  2. services:
  3. mysql1:
  4. container_name: mysql1
  5. command: --default-authentication-plugin=mysql_native_password
  6. image: "mysql"
  7. ports:
  8. - "3307:3307"
  9. volumes:
  10. - ./master.cnf:/etc/mysql/conf.d/mysql.conf.cnf
  11. environment:
  12. - MYSQL_ROOT_PASSWORD=mysql1
  13. - MYSQL_TCP_PORT=3307
  14. - MYSQL_USER=monitoruser
  15. - MYSQL_PASSWORD=monitorpass
  16. - MYSQL_DATABASE=application
  17. mysql2:
  18. container_name: mysql2
  19. image: "mysql"
  20. ports:
  21. - "3308:3308"
  22. volumes:
  23. - ./replica.cnf:/etc/mysql/conf.d/mysql.conf.cnf
  24. environment:
  25. - MYSQL_ROOT_PASSWORD=mysql2
  26. - MYSQL_TCP_PORT=3308
  27. - MYSQL_USER=monitoruser
  28. - MYSQL_PASSWORD=monitorpass
  29. - MYSQL_DATABASE=application
  30. links:
  31. - "mysql1:mysql1"
  32. mysqlproxy:
  33. container_name: mysqlproxy
  34. image: "proxysql/proxysql"
  35. volumes:
  36. - ./proxysql.cnf:/etc/proxysql.cnf
  37. links:
  38. - "mysql1:mysql1"
  39. - "mysql2:mysql2"
  40. ports:
  41. - "16032:6032"
  42. - "16033:6033"
  43. - "16070:6070"