/
docker-compose.yml
164 lines (153 loc) · 3.97 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
version: '3.9'
services:
frontend:
depends_on:
- user-service
- matching-service
- collaboration-service
- history-service
- communication-service
container_name: frontend
build:
context: ./frontend
volumes:
- ./frontend:/app/frontend
- /app/frontend/node_modules
ports:
- '3000:3000'
environment:
NEXT_PUBLIC_USER_SERVICE_PORT: 8001
NEXT_PUBLIC_MATCHING_SERVICE_PORT: 8002
NEXT_PUBLIC_QUESTION_SERVICE_PORT: 8003
NEXT_PUBLIC_COLLABORATION_SERVICE_PORT: 8004
NEXT_PUBLIC_HISTORY_SERVICE_PORT: 8005
NEXT_PUBLIC_COMMUNICATION_SERVICE_PORT: 8006
networks:
- cs3219-project-network
user-service:
container_name: user-service
depends_on:
- mongo_db
- history-service
build:
context: ./backend
dockerfile: Dockerfile.user
volumes:
- ./backend/user-service:/app/backend/user-service
- /app/backend/user-service/node_modules
ports:
- '8001:8001'
environment:
JWT_SECRET: jwt-secret
DB_URI: mongodb://mongo_db:27017/user
HISTORY_URL: 'http://history-service:8005/history'
STATISTICS_URL: 'http://history-service:8005/stats'
networks:
- cs3219-project-network
matching-service:
container_name: matching-service
depends_on:
- question-service
build:
context: ./backend
dockerfile: Dockerfile.matching
volumes:
- ./backend/matching-service:/app/backend/matching-service
- /app/backend/matching-service/node_modules
ports:
- '8002:8002'
environment:
QUESTION_DIFFICULTY_URL: 'http://question-service:8003/difficulty'
networks:
- cs3219-project-network
question-service:
container_name: question-service
depends_on:
- mongo_db
build:
context: ./backend
dockerfile: Dockerfile.question
volumes:
- ./backend/question-service:/app/backend/question-service
- /app/backend/question-service/node_modules
ports:
- '8003:8003'
environment:
DB_URI: mongodb://mongo_db:27017/question
networks:
- cs3219-project-network
collaboration-service:
container_name: collaboration-service
depends_on:
- redis
- history-service
build:
context: ./backend
dockerfile: Dockerfile.collaboration
volumes:
- ./backend/collaboration-service:/app/backend/collaboration-service
- /app/backend/collaboration-service/node_modules
ports:
- '8004:8004'
environment:
REDIS_HOST: 'redis'
HISTORY_URL: 'http://history-service:8005'
networks:
- cs3219-project-network
history-service:
container_name: history-service
depends_on:
- mongo_db
build:
context: ./backend
dockerfile: Dockerfile.history
volumes:
- ./backend/history-service:/app/backend/history-service
- /app/backend/history-service/node_modules
ports:
- '8005:8005'
environment:
DB_URI: mongodb://mongo_db:27017/history
QUESTION_URL: http://question-service:8003
networks:
- cs3219-project-network
communication-service:
container_name: communication-service
build:
context: ./backend
dockerfile: Dockerfile.communication
volumes:
- ./backend/communication-service:/app/backend/communication-service
- /app/backend/communication-service/node_modules
ports:
- '8006:8006'
networks:
- cs3219-project-network
mongo_db:
container_name: mongo_db
image: mongo:latest
restart: always
ports:
- '27017:27017'
volumes:
- mongo_db:/data/db
networks:
- cs3219-project-network
logging:
driver: 'none'
redis:
container_name: redis
image: redis:latest
restart: always
ports:
- '6379:6379'
volumes:
- redisdata:/data
networks:
- cs3219-project-network
networks:
cs3219-project-network:
driver: bridge
volumes:
mongo_db: {}
redisdata: {}