Skip to content

Refactor docker compose, closes #410 #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 34 additions & 15 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
version: '3.2'
version: '3.4'

x-mysql: &mysql
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: true
command: >
mysqld
--log-bin=mysql-bin.log
--server-id 1
--binlog-format=row
--gtid_mode=on
--enforce-gtid-consistency=on
--log_slave_updates

x-mariadb: &mariadb
environment:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
command: |
--server-id=1
--default-authentication-plugin=mysql_native_password
--log-bin=master-bin
--binlog-format=row
--log-slave-updates=on

services:
percona-5.7:
platform: linux/amd64
<<: *mysql
image: percona:5.7
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: pymysqlreplication_test
ports:
- 3306:3306
command: mysqld --log-bin=mysql-bin.log --server-id 1 --binlog-format=row --gtid_mode=on --enforce-gtid-consistency=on --log_slave_updates
restart: always
networks:
- default
- "3306:3306"

percona-5.7-ctl:
<<: *mysql
image: percona:5.7
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: pymysqlreplication_test
ports:
- 3307:3307
command: mysqld --log-bin=mysql-bin.log --server-id 1 --binlog-format=row --gtid_mode=on --enforce-gtid-consistency=on --log_slave_updates -P 3307
- "3307:3306"

mariadb-10.6:
<<: *mariadb
image: mariadb:10.6
ports:
- "3308:3306"

pymysqlreplication:
build:
Expand Down
51 changes: 27 additions & 24 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
version: '3.2'
version: '3.4'

x-mysql: &mysql
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: true
command: >
mysqld
--log-bin=mysql-bin.log
--server-id 1
--binlog-format=row
--gtid_mode=on
--enforce-gtid-consistency=on

x-mariadb: &mariadb
environment:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
command: |
--log-bin=master-bin
--server-id=1
--default-authentication-plugin=mysql_native_password
--binlog-format=row

services:
percona-5.7:
<<: *mysql
image: percona:5.7
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: true
ports:
- 3306:3306
command: mysqld --log-bin=mysql-bin.log --server-id 1 --binlog-format=row --gtid_mode=on --enforce-gtid-consistency=on --log_slave_updates
- "3306:3306"

percona-5.7-ctl:
<<: *mysql
image: percona:5.7
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: true
ports:
- 3307:3307
command: mysqld --log-bin=mysql-bin.log --server-id 1 --binlog-format=row --gtid_mode=on --enforce-gtid-consistency=on --log_slave_updates -P 3307
- "3307:3306"

mariadb-10.6:
<<: *mariadb
image: mariadb:10.6
environment:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
ports:
- "3308:3306"
command: |
--server-id=1
--default-authentication-plugin=mysql_native_password
--log-bin=master-bin
--binlog-format=row
--log-slave-updates=on
volumes:
- type: bind
source: ./.mariadb
target: /opt/key_file
- type: bind
source: ./.mariadb/my.cnf
target: /etc/mysql/my.cnf