HighLoad_HomeWork/cicd/docker-compose.yml

52 lines
1.3 KiB
YAML

version: '3'
services:
mysql_master:
image: actency/docker-mysql-replication:5.7
hostname: "mysql_master"
container_name: mysql_master
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: app
MYSQL_PASSWORD: app
MYSQL_DATABASE: app
REPLICATION_USER: replication_user
REPLICATION_PASSWORD: myreplpassword
volumes:
- /opt/mysql_master:/var/lib/mysql
- ./mysql/master_init:/docker-entrypoint-initdb.d
mysql_slave:
image: actency/docker-mysql-replication:5.7
hostname: "mysql_slave"
container_name: mysql_slave
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: app
MYSQL_PASSWORD: app
MYSQL_DATABASE: app
REPLICATION_USER: replication_user
REPLICATION_PASSWORD: myreplpassword
MASTER_HOST: mysql_master
depends_on:
- mysql_master
volumes:
- /opt/mysql_slave:/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: 13306
APP_DSN_USER: app
APP_DSN_PASS: app
APP_DSN_BASE: app
ports:
- "8080:8080"