HighLoad_HomeWork/cicd/docker-compose.yml

61 lines
1.5 KiB
YAML

version: '3'
services:
mysql_master:
image: mysql:5.7
hostname: "mysql_master"
container_name: mysql_master
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_PORT: 3306
MYSQL_LOWER_CASE_TABLE_NAMES: 0
volumes:
- ./mysql/mysql_master.conf:/etc/mysql/conf.d/mysql.conf.cnf
- /opt/mysql_master:/var/lib/mysql
mysql_slave1:
image: mysql:5.7
hostname: "mysql_slave1"
container_name: mysql_slave1
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_PORT: 3306
MYSQL_LOWER_CASE_TABLE_NAMES: 0
depends_on:
- mysql_master
volumes:
- ./mysql/mysql_slave1.conf:/etc/mysql/conf.d/mysql.conf.cnf
- /opt/mysql_slave1:/var/lib/mysql
mysql_slave2:
image: mysql:5.7
hostname: "mysql_slave2"
container_name: mysql_slave2
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_PORT: 3306
MYSQL_LOWER_CASE_TABLE_NAMES: 0
depends_on:
- mysql_master
volumes:
- ./mysql/mysql_slave2.conf:/etc/mysql/conf.d/mysql.conf.cnf
- /opt/mysql_slave2:/var/lib/mysql
app:
build:
context: ..
dockerfile: ./cicd/app/Dockerfile
restart: always
environment:
APP_SERVER_ADDRESS: 0.0.0.0
APP_SERVER_PORT: 8080
APP_DSN_HOST: mysql_master
APP_DSN_PORT: 3306
APP_DSN_USER: app
APP_DSN_PASS: app
APP_DSN_BASE: app
ports:
- "8080:8080"