generated from CS3219-AY2324S1/course-assessment-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
173 lines (161 loc) · 3.99 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
version: '3'
services:
http-gateway:
build:
context: .
dockerfile: ./apps/http-gateway/Dockerfile
target: dev
image: chownces/backend-http-gateway
depends_on:
sql-migrations:
condition: service_completed_successfully
ports:
- ${HTTP_GATEWAY_PORT}:${HTTP_GATEWAY_PORT}
networks:
- backend
env_file:
.env.docker
ws-gateway:
build:
context: .
dockerfile: ./apps/ws-gateway/Dockerfile
target: dev
image: chownces/backend-ws-gateway
depends_on:
sql-migrations:
condition: service_completed_successfully
redis:
condition: service_healthy
ports:
- ${WS_GATEWAY_PORT}:${WS_GATEWAY_PORT}
networks:
- backend
env_file: .env.docker
question:
build:
context: .
dockerfile: ./apps/question/Dockerfile
image: chownces/backend-question
depends_on:
sql-migrations:
condition: service_completed_successfully
networks:
- backend
env_file: .env.docker
user:
build:
context: .
dockerfile: ./apps/user/Dockerfile
image: chownces/backend-user
depends_on:
sql-migrations:
condition: service_completed_successfully
networks:
- backend
env_file: .env.docker
collaboration:
build:
context: .
dockerfile: ./apps/collaboration/Dockerfile
image: chownces/backend-collaboration
depends_on:
sql-migrations:
condition: service_completed_successfully
networks:
- backend
env_file: .env.docker
matching:
build:
context: .
dockerfile: ./apps/matching/Dockerfile
image: chownces/backend-matching
depends_on:
sql-migrations:
condition: service_completed_successfully
redis:
condition: service_healthy
networks:
- backend
env_file: .env.docker
chatbot:
build:
context: .
dockerfile: ./apps/chatbot/Dockerfile
image: chownces/backend-chatbot
depends_on:
sql-migrations:
condition: service_completed_successfully
networks:
- backend
env_file: .env.docker
postgres:
image: postgres:14.1-alpine
restart: always
volumes:
- ./postgres-data:/var/lib/postgresql/data # Persist data between restarts
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
networks:
- backend
healthcheck:
test: ['CMD-SHELL', 'pg_isready']
interval: 10s
timeout: 5s
retries: 5
mongo:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
networks:
- backend
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 5s
timeout: 20s
retries: 5
start_period: 20s
sql-migrations:
build:
context: .
dockerfile: ./scripts/Dockerfile
depends_on:
postgres:
condition: service_healthy
mongo:
condition: service_healthy
env_file: .env.docker
environment:
- QUESTION_SERVICE_MONGODB_URL=mongodb://root:root@mongo:27017/peer-prep-question?authMechanism=DEFAULT
- COLLABORATION_SERVICE_MONGODB_URL=mongodb://root:root@mongo:27017/peer-prep-collaboration?authMechanism=DEFAULT
networks:
- backend
# rabbitmq:
# image: rabbitmq:management
# environment:
# - RABBITMQ_DEFAULT_USER=guest
# - RABBITMQ_DEFAULT_PASS=guest
# networks:
# - backend
# healthcheck:
# test: [ "CMD", "rabbitmqctl", "status"]
# interval: 5s
# timeout: 20s
# retries: 5
redis:
image: redis:7.2-alpine
restart: always
networks:
- backend
env_file: .env.docker
command: redis-server --save 60 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
healthcheck:
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
interval: 10s
timeout: 5s
retries: 5
networks:
backend:
driver: bridge