-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
190 lines (178 loc) · 4.58 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
version: '3.9'
services:
question-service:
container_name: question-service
restart: on-failure
build:
context: ./services/question-service
args:
- PORT=${QUESTION_PORT}
image: ${DOCKER_USERNAME}/question-service:latest
ports:
- "${QUESTION_PORT}:${QUESTION_PORT}"
environment:
PORT: ${QUESTION_PORT}
DB_CLOUD_URI: ${QUESTION_DB_CLOUD_URI}
DB_LOCAL_URI: ${QUESTION_DB_LOCAL_URI}
ENV: ${ENV}
depends_on:
- question-db
networks:
- app-network
question-db:
image: mongodb/mongodb-atlas-local
ports:
- "27018:27018"
networks:
- app-network
user-service:
container_name: user-service
restart: on-failure
build:
context: ./services/user-service
args:
- PORT=${USER_PORT}
image: ${DOCKER_USERNAME}/user-service:latest
ports:
- "${USER_PORT}:${USER_PORT}"
environment:
PORT: ${USER_PORT}
DB_CLOUD_URI: ${USER_DB_CLOUD_URI}
DB_LOCAL_URI: ${USER_DB_LOCAL_URI}
ENV: ${ENV}
JWT_SECRET: ${JWT_SECRET}
EMAIL_USER: ${EMAIL_USER}
EMAIL_PASSWORD: ${EMAIL_PASSWORD}
FRONTEND_URL: ${FRONTEND_URL}
depends_on:
- user-db
networks:
- app-network
user-db:
image: mongodb/mongodb-atlas-local
ports:
- "27019:27019"
networks:
- app-network
matching-service:
container_name: matching-service
restart: on-failure
build:
context: ./services/matching-service
args:
- PORT=${MATCHING_PORT}
- REDIS_HOST=redis
- REDIS_PORT=6379
ports:
- "${MATCHING_PORT}:${MATCHING_PORT}"
image: ${DOCKER_USERNAME}/matching-service:latest
environment:
PORT: ${MATCHING_PORT}
REDIS_HOST: redis
REDIS_PORT: 6379
ENV: ${ENV}
depends_on:
- redis
networks:
- app-network
collaboration-service:
container_name: collaboration-service
restart: on-failure
build:
context: ./services/collaboration-service
args:
- PORT=${COLLAB_PORT}
image: ${DOCKER_USERNAME}/collaboration-service:latest
ports:
- "${COLLAB_PORT}:${COLLAB_PORT}"
environment:
PORT: ${COLLAB_PORT}
HISTORY_PORT: ${HISTORY_PORT}
ENV: ${ENV}
DB_CLOUD_URI: ${COLLAB_DB_CLOUD_URI}
DB_LOCAL_URI: ${COLLAB_DB_LOCAL_URI}
networks:
- app-network
redis:
image: redis:alpine
restart: on-failure
ports:
- "6379:6379"
networks:
- app-network
api-gateway:
container_name: api-gateway
restart: on-failure
build:
context: ./services/api-gateway
args:
- PORT=${GATEWAY_PORT}
- QUESTION_PORT=${QUESTION_PORT}
- USER_PORT=${USER_PORT}
- COLLAB_PORT=${COLLAB_PORT}
- HISTORY_PORT=${HISTORY_PORT}
- HISTORY_URL=http://history-service
- USER_URL=http://user-service
- QUESTION_URL=http://question-service
- COLLAB_URL=http://collaboration-service
image: ${DOCKER_USERNAME}/api-gateway:latest
ports:
- "${GATEWAY_PORT}:${GATEWAY_PORT}"
environment:
PORT: ${GATEWAY_PORT}
QUESTION_PORT: ${QUESTION_PORT}
USER_PORT: ${USER_PORT}
COLLAB_PORT: ${COLLAB_PORT}
HISTORY_PORT: ${HISTORY_PORT}
HISTORY_URL: http://history-service
USER_URL: http://user-service
QUESTION_URL: http://question-service
COLLAB_URL: http://collaboration-service
depends_on:
- question-service
- user-service
- history-service
- collaboration-service
networks:
- app-network
frontend:
build: ./frontend
image: ${DOCKER_USERNAME}/frontend:latest
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- api-gateway
networks:
- app-network
history-service:
container_name: history-service
restart: on-failure
build:
context: ./services/history-service
args:
- PORT=${HISTORY_PORT}
image: ${DOCKER_USERNAME}/history-service:latest
ports:
- "${HISTORY_PORT}:${HISTORY_PORT}"
environment:
PORT: ${HISTORY_PORT}
QUESTION_PORT: ${QUESTION_PORT}
DB_CLOUD_URI: ${HISTORY_DB_CLOUD_URI}
DB_LOCAL_URI: ${HISTORY_DB_LOCAL_URI}
ENV: ${ENV}
depends_on:
- history-db
networks:
- app-network
history-db:
image: mongodb/mongodb-atlas-local
ports:
- "27020:27020"
networks:
- app-network
networks:
app-network:
driver: bridge