File tree Expand file tree Collapse file tree 3 files changed +28
-11
lines changed Expand file tree Collapse file tree 3 files changed +28
-11
lines changed Original file line number Diff line number Diff line change
1
+ MYSQL1_SAVE_PATH = mysql1
2
+ MYSQL2_SAVE_PATH = mysql2
3
+ ROOT_PASSWORD = 123456
4
+ DATABASE = kingshard
Original file line number Diff line number Diff line change
1
+ mysql1 /
2
+ mysql2 /
Original file line number Diff line number Diff line change @@ -5,29 +5,40 @@ networks:
5
5
name : testwifi
6
6
services :
7
7
mysql1 :
8
+ container_name : " mysql1"
8
9
image : mysql:latest
10
+ volumes :
11
+ - ./${MYSQL1_SAVE_PATH}:/var/lib/mysql
9
12
expose :
10
- - " 3306"
13
+ - " 3306"
11
14
environment :
12
- - MYSQL_ROOT_PASSWORD=123456
13
- - MYSQL_DATABASE=kingshard
15
+ - MYSQL_ROOT_PASSWORD=${ROOT_PASSWORD}
16
+ - MYSQL_DATABASE=${DATABASE}
17
+ restart : always
14
18
15
19
mysql2 :
20
+ container_name : " mysql2"
16
21
image : mysql:latest
22
+ volumes :
23
+ - ./${MYSQL2_SAVE_PATH}:/var/lib/mysql
17
24
expose :
18
- - " 3306"
25
+ - " 3306"
19
26
environment :
20
- - MYSQL_ROOT_PASSWORD=123456
21
- - MYSQL_DATABASE=kingshard
27
+ - MYSQL_ROOT_PASSWORD=${ROOT_PASSWORD}
28
+ - MYSQL_DATABASE=${DATABASE}
29
+ restart : always
22
30
23
31
kingshard :
32
+ container_name : " kingshard"
33
+ image : mysql:latest
24
34
image : matjazmav/kingshard
25
35
volumes :
26
- - ./ks1.yaml:/etc/ks.yaml
36
+ - ./ks1.yaml:/etc/ks.yaml
27
37
ports :
28
- - " 9696:9696"
38
+ - " 9696:9696"
29
39
expose :
30
- - " 9696"
40
+ - " 9696"
31
41
links :
32
- - mysql1
33
- - mysql2
42
+ - mysql1
43
+ - mysql2
44
+ restart : always
You can’t perform that action at this time.
0 commit comments