-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose_async_repl.yml
63 lines (63 loc) · 1.29 KB
/
docker-compose_async_repl.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
version: '3.3'
services:
app:
build:
context: .
dockerfile: Dockerfile
environment:
DB_DATABASE: 'db'
DB_USER: 'user'
DB_PASSWORD: 'password'
DB_ADDRESS: 'db:3306'
DB_REPLICA_ADDRESSES: 'db_replica:3306'
depends_on:
- db
- db_replica
ports:
- '8080:8080'
expose:
- '8080'
networks:
- backend
db:
image: mysql:8.0
restart: always
environment:
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- my-db:/var/lib/mysql
- ${PWD}/db/people.csv:/var/lib/mysql-files/people.csv
- ${PWD}/db/async/mysql.cnf:/etc/mysql/conf.d/mysql.cnf
networks:
- backend
db_replica:
image: mysql:8.0
restart: always
environment:
MYSQL_DATABASE: 'db'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
depends_on:
- db
ports:
- '3307:3306'
expose:
- '3307'
volumes:
- my-db-replica:/var/lib/mysql
- ${PWD}/db/async/mysql_replica.cnf:/etc/mysql/conf.d/mysql.cnf
networks:
- backend
networks:
backend:
volumes:
my-db:
my-db-replica: