generated from CS3219-AY2324S1/course-assessment-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.test.yml
147 lines (136 loc) · 3.21 KB
/
docker-compose.test.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
version: '3'
services:
http-gateway:
build:
context: .
dockerfile: ./apps/http-gateway/Dockerfile
target: test
depends_on:
sql-migrations:
condition: service_completed_successfully
networks:
- backend
env_file:
.env.test
ws-gateway:
build:
context: .
dockerfile: ./apps/ws-gateway/Dockerfile
target: test
depends_on:
sql-migrations:
condition: service_completed_successfully
redis:
condition: service_healthy
networks:
- backend
env_file: .env.test
question:
build:
context: .
dockerfile: ./apps/question/Dockerfile
depends_on:
sql-migrations:
condition: service_completed_successfully
networks:
- backend
env_file: .env.test
user:
build:
context: .
dockerfile: ./apps/user/Dockerfile
depends_on:
sql-migrations:
condition: service_completed_successfully
networks:
- backend
env_file: .env.test
collaboration:
build:
context: .
dockerfile: ./apps/collaboration/Dockerfile
depends_on:
sql-migrations:
condition: service_completed_successfully
networks:
- backend
env_file: .env.test
matching:
build:
context: .
dockerfile: ./apps/matching/Dockerfile
depends_on:
sql-migrations:
condition: service_completed_successfully
redis:
condition: service_healthy
networks:
- backend
env_file: .env.test
chatbot:
build:
context: .
dockerfile: ./apps/chatbot/Dockerfile
depends_on:
sql-migrations:
condition: service_completed_successfully
networks:
- backend
env_file: .env.test
postgres:
image: postgres:14.1-alpine
restart: always
networks:
- backend
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
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
networks:
- backend
depends_on:
postgres:
condition: service_healthy
mongo:
condition: service_healthy
env_file: .env.test
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
redis:
image: redis:7.2-alpine
restart: always
networks:
- backend
env_file: .env.test
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