47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
# Copyright Broadcom, Inc. All Rights Reserved.
|
|
# SPDX-License-Identifier: APACHE-2.0
|
|
|
|
services:
|
|
primary:
|
|
image: docker.io/bitnami/percona-mysql:8.4
|
|
ports:
|
|
- '3306'
|
|
volumes:
|
|
- 'primary_data:/bitnami/mysql/data'
|
|
environment:
|
|
- MYSQL_REPLICATION_MODE=master
|
|
- MYSQL_REPLICATION_USER=repl_user
|
|
- MYSQL_REPLICATION_PASSWORD=repl_password
|
|
- MYSQL_USER=my_user
|
|
- MYSQL_PASSWORD=my_password
|
|
- MYSQL_DATABASE=my_database
|
|
- MYSQL_ROOT_PASSWORD=my_root_password
|
|
healthcheck:
|
|
test: ['CMD', '/opt/bitnami/scripts/mysql/healthcheck.sh']
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 6
|
|
|
|
secondary:
|
|
image: docker.io/bitnami/percona-mysql:8.4
|
|
ports:
|
|
- '3306'
|
|
depends_on:
|
|
- primary
|
|
environment:
|
|
- MYSQL_REPLICATION_MODE=slave
|
|
- MYSQL_REPLICATION_USER=repl_user
|
|
- MYSQL_REPLICATION_PASSWORD=repl_password
|
|
- MYSQL_MASTER_HOST=primary
|
|
- MYSQL_MASTER_PORT_NUMBER=3306
|
|
- MYSQL_MASTER_ROOT_PASSWORD=my_root_password
|
|
healthcheck:
|
|
test: ['CMD', '/opt/bitnami/scripts/mysql/healthcheck.sh']
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 6
|
|
|
|
volumes:
|
|
primary_data:
|
|
driver: local
|