-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
224 lines (211 loc) · 5.02 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
version: '3.8'
x-common-variables: &shared-variables
NODE_ENV: development
PORT: 3000
AUTH_URL: http://auth:3000
CODE_EXECUTOR_URL: http://code-executor:3000
CODING_URL: http://coding:3000
HISTORY_URL: http://history:3000
PAIRING_URL: http://pairing:3000
VIDEO_URL: http://video:3000
ROOM_URL: http://room:3000
JUDGE_URL: http://jh123x.tk:2358
networks:
frontend:
backend:
services:
frontend:
image: jh123x/frontend
container_name: frontend
build:
# Context is . because of eslint in root
dockerfile: frontend/Dockerfile.dev
context: .
volumes:
- ~/.cache/yarn:/home/node/.cache/yarn
- ./frontend:/home/node/app/frontend
ports:
- 3000:3000
restart: on-failure
networks:
- frontend
environment:
NODE_ENV: development
PORT: 3000
SKIP_PREFLIGHT_CHECK: 'true'
REACT_APP_BACKEND_API: http://localhost:4000
REACT_APP_BACKEND_WS_API: ws://localhost:4000
REACT_APP_FIREBASE_API_KEY: AIzaSyASaqw4fLp2DYyfmVRfQojpXcvFzlcVKs8
REACT_APP_FIREBASE_AUTH_DOMAIN: code2gather-df5c6.firebaseapp.com
REACT_APP_FIREBASE_PROJECT_ID: code2gather-df5c6
REACT_APP_FIREBASE_STORAGE_BUCKET: code2gather-df5c6.appspot.com
REACT_APP_FIREBASE_MESSAGING_SENDER_ID: 333844889339
REACT_APP_FIREBASE_APP_ID: 1:333844889339:web:e8aee02dd38ceceefd3a5e
REACT_APP_FIREBASE_MEASUREMENT_ID: G-MFN27CTW6J
REACT_APP_AGORA_APP_ID: 6e61da63d86d4d96951c2d27054273b1
gateway:
image: jh123x/gateway
container_name: gateway
build:
dockerfile: Dockerfile.dev
context: ./gateway
volumes:
- ~/.cache/yarn:/home/node/.cache/yarn
- ./gateway:/home/node/app/gateway
ports:
- 4000:3000
restart: on-failure
networks:
- frontend
- backend
environment:
<<: *shared-variables
auth:
image: jh123x/auth
container_name: auth
build:
dockerfile: Dockerfile.dev
context: ./auth
volumes:
- ~/.cache/yarn:/home/node/.cache/yarn
- ./auth:/home/node/app/auth
expose:
- 3000
restart: on-failure
networks:
- backend
environment:
<<: *shared-variables
FIREBASE_PROJECT_ID:
FIREBASE_CLIENT_EMAIL:
FIREBASE_PRIVATE_KEY:
JWT_SECRET: code2gather
coding:
image: jh123x/coding
container_name: coding
build:
dockerfile: Dockerfile.dev
context: ./coding
volumes:
- ~/.cache/yarn:/home/node/.cache/yarn
- ./coding:/home/node/app/coding
expose:
- 3000
restart: on-failure
networks:
- backend
environment:
<<: *shared-variables
code-executor:
image: jh123x/code-executor
container_name: code-executor
build:
dockerfile: Dockerfile.dev
context: ./code-executor
volumes:
- ~/.cache/yarn:/home/node/.cache/yarn
- ./code-executor:/home/node/app/code-executor
expose:
- 3000
restart: on-failure
networks:
- backend
environment:
<<: *shared-variables
history:
image: jh123x/history
container_name: history
build:
dockerfile: Dockerfile.dev
context: ./history
volumes:
- ~/.cache/yarn:/home/node/.cache/yarn
- ./history:/home/node/app/history
expose:
- 3000
restart: on-failure
networks:
- backend
depends_on:
- db
environment:
<<: *shared-variables
DATABASE_URL: postgresql://postgres:postgres@db/postgres?connect_timeout=300
pairing:
image: jh123x/pairing
container_name: pairing
build:
dockerfile: Dockerfile.dev
context: ./pairing
volumes:
- ~/.cache/yarn:/home/node/.cache/yarn
- ./pairing:/home/node/app/pairing
expose:
- 3000
restart: on-failure
networks:
- backend
environment:
<<: *shared-variables
room:
image: jh123x/room
container_name: room
build:
dockerfile: Dockerfile.dev
context: ./room
volumes:
- ./room:/home/node/app/room
expose:
- 3000
restart: on-failure
networks:
- backend
depends_on:
- mongo
environment:
<<: *shared-variables
MONGODB_URL: mongodb://mongo
video:
image: jh123x/video
container_name: video
build:
dockerfile: Dockerfile.dev
context: ./video
volumes:
- ~/.cache/yarn:/home/node/.cache/yarn
- ./video:/home/node/app/video
expose:
- 3000
restart: on-failure
networks:
- backend
environment:
<<: *shared-variables
APP_ID:
APP_CERTIFICATE:
db:
container_name: db
image: postgres:12
restart: always
volumes:
- ./postgres-data:/var/lib/postgresql/data/
logging:
driver: none
networks:
- backend
ports:
- 15432:5432
environment:
POSTGRES_PASSWORD: postgres
mongo:
container_name: mongo
image: mongo:4
restart: always
volumes:
- ./mongodb-data:/data/db
logging:
driver: none
networks:
- backend
ports:
- 27017:27017