generated from CS3219-AY2324S1/course-assessment-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
129 lines (117 loc) · 2.86 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
version: "3.9"
services:
question-service:
build: ./backend/question-service
ports:
- 8080:8080
volumes:
- ./backend/question-service:/usr/src/app
env_file: ./backend/question-service/.env
frontend:
build: ./frontend
volumes:
- ./frontend:/app
ports:
- 3000:3000
env_file: ./frontend/.env
user-service:
build: ./backend/user-service
ports:
- 8000:8000
volumes:
- ./backend/user-service:/usr/src/app
depends_on:
- postgres
env_file: ./backend/user-service/.env.docker
postgres:
image: postgres
restart: always
environment:
POSTGRES_DB: peerprep
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1m30s
ports:
- 5432:5432
migration:
build: ./backend/user-service
depends_on:
postgres:
condition: service_healthy
command: ["npx", "prisma", "db", "push", ";", "npm", "run", "seed"]
env_file: ./backend/user-service/.env.docker
matching-service:
build: ./backend/matching-service
ports:
- 9000:9000
volumes:
- ./backend/matching-service:/usr/src/app
env_file: ./backend/matching-service/.env
depends_on:
- rabbitmq
forum-service:
build: ./backend/forum-service
ports:
- 9001:9001
volumes:
- ./backend/forum-service:/usr/src/app
env_file: ./backend/forum-service/.env
depends_on:
- postgres
api-gateway:
build: ./backend/api-gateway
ports:
- 7777:8080
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
ports:
- "5672:5672"
- "15672:15672"
command:
[
"bash",
"-c",
"chmod 400 /var/lib/rabbitmq/.erlang.cookie; rabbitmq-server",
]
healthcheck:
test: rabbitmq-diagnostics check_port_connectivity
interval: 1s
timeout: 3s
retries: 30
chat-service:
build: ./backend/chat-service
ports:
- 8084:8084
volumes:
- ./backend/chat-service:/usr/src/app
env_file: ./backend/chat-service/.env
collaboration-service:
build: ./backend/collaboration-service
ports:
- 8082:8082
volumes:
- ./backend/collaboration-service:/usr/src/app
env_file: ./backend/collaboration-service/.env
depends_on:
rabbitmq:
condition: service_healthy
y-websocket:
image: ipirozhenko/y-websocket
ports:
- 8081:8081
environment:
- PORT=8081
help-service:
build: ./backend/help-service
ports:
- 10000:10000
volumes:
- ./backend/help-service:/usr/src/app
env_file: ./backend/help-service/.env
# https://medium.com/@sumankpaul/run-db-migration-script-in-docker-compose-ce8e447a77ba