-
Notifications
You must be signed in to change notification settings - Fork 38
/
docker-compose-dev.yaml
233 lines (219 loc) · 5.77 KB
/
docker-compose-dev.yaml
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
services:
educational-program:
image: educational-program-img
restart: always
build:
context: ./educational-program
dockerfile: Dockerfile.dev
container_name: EducationalProgramCont
env_file: "./educational-program/.env"
ports:
- "8000:8000"
volumes:
- ./educational-program:/workspace
# - .:/workspace:cached
command:
- bash
- -c
- |
poetry install
alembic upgrade head
python app/init_data.py
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
networks:
- university-gpt-net
depends_on:
- postgres_edu_dev_db
environment:
- PYTHONPATH=/workspace
user-management:
image: user-management-img
restart: always
build:
context: ./user-management
dockerfile: Dockerfile.dev
env_file: "./user-management/.env"
container_name: UserManagementCont
ports:
- "8001:8001"
volumes:
- ./user-management:/workspace
# - .:/workspace:cached
command:
- bash
- -c
- |
ls
poetry install
uvicorn app.main:app --reload --host 0.0.0.0 --port 8001
networks:
- university-gpt-net
depends_on:
- postgres_auth_dev_db
environment:
- PYTHONPATH=/workspace
quiz-engine:
image: quiz-engine-img
restart: always
build:
context: ./quiz-engine
dockerfile: Dockerfile.dev
env_file: "./quiz-engine/.env"
container_name: QuizEngineCont
ports:
- "8002:8002"
volumes:
- ./quiz-engine:/workspace
# - .:/workspace:cached
command:
- bash
- -c
- |
poetry install
alembic upgrade head
ls
python app/init_data.py
uvicorn app.main:app --reload --host 0.0.0.0 --port 8002
networks:
- university-gpt-net
depends_on:
- postgres_qse_dev_db
environment:
- PYTHONPATH=/workspace
assessment-evals:
image: assessment-evals-img
restart: always
build:
context: ./assessment-evals
dockerfile: Dockerfile.dev
env_file: "./assessment-evals/.env"
container_name: AssessmentEvalsCont
ports:
- "8003:8003"
volumes:
- ./assessment-evals:/workspace
# - .:/workspace:cached
command:
- bash
- -c
- |
poetry install
alembic upgrade head
ls
python app/init_data.py
uvicorn app.main:app --reload --host 0.0.0.0 --port 8003
networks:
- university-gpt-net
depends_on:
- postgres_answer_dev_db
environment:
- PYTHONPATH=/workspace
# A Single Test Database for All Microservices (Raw Migrations using SQLModel)
postgres_test_db:
image: postgres:latest # Use the official PostgreSQL image
restart: always
container_name: PostgresTestCont
environment:
- POSTGRES_USER=mjunaidca
- POSTGRES_PASSWORD=temp_test_pass
- POSTGRES_DB=postgres_test_db
ports:
- "5433:5432"
volumes:
- postgres_test_db:/var/lib/postgresql/data
networks:
- university-gpt-net
# A Seperate Development Database for Each Microservice (Alembic for Migrations)
#1. Education Program Microservice Development Database
postgres_edu_dev_db:
image: postgres:latest # Use the official PostgreSQL image
restart: always
container_name: PostgresEduDevCont
environment:
- POSTGRES_USER=mjunaidca
- POSTGRES_PASSWORD=temp_edu_dev_pass
- POSTGRES_DB=postgres_edu_dev_db
ports:
- "5434:5432"
volumes:
- postgres_edu_dev_db:/var/lib/postgresql/data
networks:
- university-gpt-net
#2. Question Bank Microservice Development Database (Question Bank + Topics)
postgres_qse_dev_db:
image: postgres:latest # Use the official PostgreSQL image
restart: always
container_name: PostgresQSEDevCont
environment:
- POSTGRES_USER=mjunaidca
- POSTGRES_PASSWORD=temp_qse_dev_pass
- POSTGRES_DB=postgres_qse_dev_db
ports:
- "5435:5432"
volumes:
- postgres_qse_dev_db:/var/lib/postgresql/data
networks:
- university-gpt-net
#3. Quiz management Microservice Development Database (Quiz + Quiz Engine)
postgres_answer_dev_db:
image: postgres:latest # Use the official PostgreSQL image
restart: always
container_name: PostgresAnswerDevCont
environment:
- POSTGRES_USER=mjunaidca
- POSTGRES_PASSWORD=temp_answer_dev_pass
- POSTGRES_DB=postgres_answer_dev_db
ports:
- "5436:5432"
volumes:
- postgres_answer_dev_db:/var/lib/postgresql/data
networks:
- university-gpt-net
postgres_auth_dev_db:
image: postgres:latest # Use the official PostgreSQL image
restart: always
container_name: PostgresAuthDevCont
environment:
- POSTGRES_USER=mjunaidca
- POSTGRES_PASSWORD=temp_auth_dev_pass
- POSTGRES_DB=postgres_auth_dev_db
ports:
- "5437:5432"
volumes:
- postgres_auth_dev_db:/var/lib/postgresql/data
networks:
- university-gpt-net
pgadmin:
image: dpage/pgadmin4:8.6
restart: always
container_name: PgAdmin4Cont
ports:
- "8010:80"
environment:
- PGADMIN_DEFAULT_PASSWORD=SuperSecret
volumes:
- pgadmin:/var/lib/pgadmin
depends_on:
- postgres_test_db
- postgres_edu_dev_db
- postgres_qse_dev_db
- postgres_answer_dev_db
- postgres_auth_dev_db
networks:
- university-gpt-net
volumes:
postgres_test_db:
driver: local
postgres_edu_dev_db:
driver: local
postgres_qse_dev_db:
driver: local
postgres_answer_dev_db:
driver: local
postgres_auth_dev_db:
driver: local
pgadmin:
driver: local
networks:
university-gpt-net: # Define the custom network