-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
176 lines (168 loc) · 4 KB
/
docker-compose.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
version: "3.8"
services:
client:
stdin_open: true
build: ./client
depends_on:
- api
expose:
- ${CLIENT_PORT}
environment:
- CLIENT_PORT=${CLIENT_PORT}
- REACT_APP_API_URL=${API_URL}
- NODE_ENV=development
- CHOKIDAR_USEPOLLING=true
- ESLINT_NO_DEV_ERRORS=true
ports:
- ${CLIENT_PORT}:${CLIENT_PORT}
volumes:
- ./client:/srv/app/client
- /srv/app/client/node_modules
links:
- api
api:
build: ./api
depends_on:
- mysql
expose:
- ${API_PORT}
environment:
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_HOST_IP=mysql
- PORT=${API_PORT}
- S3_ENDPOINT=${S3_ENDPOINT}
- S3_LOCATION=${S3_LOCATION}
- S3_REGION=${S3_REGION}
- ACCESS_KEY_ID=${ACCESS_KEY_ID}
- SECRET_ACCESS_KEY=${SECRET_ACCESS_KEY}
- BUCKET=${BUCKET}
ports:
- ${API_PORT}:${API_PORT}
volumes:
- ./api:/srv/app/api
- /srv/app/api/node_modules
links:
- mysql
phpmyadmin:
depends_on:
- mysql
image: phpmyadmin/phpmyadmin
environment:
PMA_HOST: mysql
links:
- mysql:mysql
ports:
- 8080:80
restart: always
mysql:
image: mysql:8.0.20
environment:
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
cap_add:
- SYS_NICE
ports:
- 3306:3306
restart: unless-stopped
volumes:
- ./api/db/sample.sql:/docker-entrypoint-initdb.d/sample.sql
minio1:
image: minio/minio
volumes:
- data1-1:/data1
- data1-2:/data2
expose:
- "9000"
environment:
- MINIO_ROOT_USER=${ACCESS_KEY_ID}
- MINIO_ROOT_PASSWORD=${SECRET_ACCESS_KEY}
command: server http://minio{1...4}/data{1...2}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
minio2:
image: minio/minio
volumes:
- data2-1:/data1
- data2-2:/data2
expose:
- "9000"
environment:
- MINIO_ROOT_USER=${ACCESS_KEY_ID}
- MINIO_ROOT_PASSWORD=${SECRET_ACCESS_KEY}
command: server http://minio{1...4}/data{1...2}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
minio3:
image: minio/minio
volumes:
- data3-1:/data1
- data3-2:/data2
expose:
- "9000"
environment:
- MINIO_ROOT_USER=${ACCESS_KEY_ID}
- MINIO_ROOT_PASSWORD=${SECRET_ACCESS_KEY}
command: server http://minio{1...4}/data{1...2}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
minio4:
image: minio/minio
volumes:
- data4-1:/data1
- data4-2:/data2
expose:
- "9000"
environment:
- MINIO_ROOT_USER=${ACCESS_KEY_ID}
- MINIO_ROOT_PASSWORD=${SECRET_ACCESS_KEY}
command: server http://minio{1...4}/data{1...2}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
nginx:
image: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "9000:9000"
depends_on:
- minio1
- minio2
- minio3
- minio4
createbuckets:
image: minio/mc
depends_on:
- nginx
entrypoint: >
/bin/sh -c "
until (/usr/bin/mc config host add minio http://nginx:9000 ${ACCESS_KEY_ID} ${SECRET_ACCESS_KEY} --api S3v2) do echo '...waiting...' && sleep 1; done;
/usr/bin/mc mb minio/${BUCKET};
/usr/bin/mc policy set public minio/${BUCKET};
exit 0;
"
volumes:
data1-1:
data1-2:
data2-1:
data2-2:
data3-1:
data3-2:
data4-1:
data4-2: