Skip to content

Commit

Permalink
Add docker compose examples
Browse files Browse the repository at this point in the history
  • Loading branch information
grooverdan committed Oct 18, 2023
1 parent 70d8c97 commit 524f0b9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/compose-debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
mariadb:
image: quay.io/mariadb-foundation/mariadb-debug:11.2
volumes:
- mariadbdata:/var/lib/mysql
environment:
- MARIADB_ROOT_PASSWORD=bob
command: gdb -ex r -ex 'thread apply all bt -frame-arguments all full' --args mariadbd
user: mysql
volumes:
mariadbdata: {}
34 changes: 34 additions & 0 deletions examples/compose-replication.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: "3"
services:
master:
image: mariadb:latest
command: --log-bin --log-basename=mariadb
environment:
- MARIADB_ROOT_PASSWORD=password
- MARIADB_USER=testuser
- MARIADB_PASSWORD=password
- MARIADB_DATABASE=testdb
- MARIADB_REPLICATION_USER=repl
- MARIADB_REPLICATION_PASSWORD=replicationpass
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
timeout: 5s
retries: 3
replica:
image: mariadb:latest
command: --server-id=2 --log-basename=mariadb
environment:
- MARIADB_ROOT_PASSWORD=password
- MARIADB_MASTER_HOST=master
- MARIADB_REPLICATION_USER=repl
- MARIADB_REPLICATION_PASSWORD=replicationpass
- MARIADB_HEALTHCHECK_GRANTS=REPLICA MONITOR
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--replication_io", "--replication_sql", "--replication_seconds_behind_master=1", "--replication"]
interval: 10s
timeout: 5s
retries: 3
depends_on:
master:
condition: service_healthy

0 comments on commit 524f0b9

Please sign in to comment.