-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
210 lines (201 loc) · 6.56 KB
/
docker-compose.prod.yml
File metadata and controls
210 lines (201 loc) · 6.56 KB
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
services:
# Kong Gateway
kong-gateway:
container_name: kong-gateway
image: kong/kong-gateway:3.7.1.1
restart: unless-stopped
ports:
- "${KONG_PROXY_PORT:-8000}:8000"
- "${KONG_ADMIN_PORT:-8001}:8001"
environment:
KONG_DATABASE: "off"
KONG_DECLARATIVE_CONFIG: /kong/declarative/kong.yml
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_ADMIN_ACCESS_LOG: /dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stderr
KONG_ADMIN_ERROR_LOG: /dev/stderr
KONG_ADMIN_LISTEN: 0.0.0.0:8001
KONG_PROXY_LISTEN: 0.0.0.0:8000
volumes:
- ./kong-gateway/config:/kong/declarative
networks:
- app-network
- moodle_project_default
depends_on:
- user-service
- lti-service
- frontend-service
# User Service
user-service:
container_name: user-service
image: ${DOCKER_REGISTRY_LOC}/adaptive-learning-user-service:latest
restart: unless-stopped
ports:
- "${USER_SERVICE_PORT:-8085}:8085"
environment:
- SPRING_PROFILES_ACTIVE=${SPRING_PROFILE:-production}
- SERVER_ADDRESS=0.0.0.0
- SERVER_PORT=8085
- DATABASE_URL=jdbc:mysql://mysql8.4:3306/user_service?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
- DATABASE_USERNAME=root
- DATABASE_PASSWORD=root_pass
- JWT_SECRET=${JWT_SECRET:-default-jwt-secret-change-in-production}
- FRONTEND_URL=${FRONTEND_URL:-http://localhost:5173}
networks:
- app-network
- moodle_project_default
# LTI Service
lti-service:
container_name: lti-service
image: ${DOCKER_REGISTRY}/adaptive-learning-lti-service:latest
restart: unless-stopped
ports:
- "${LTI_SERVICE_PORT}:8082"
environment:
- HOST=0.0.0.0
- PORT=8082
- DEBUG=${DEBUG:-False}
- FRONTEND_URL=${FRONTEND_URL}
- USER_SERVICE_URL=${USER_SERVICE_URL}
- LTI_ISSUER=${LTI_ISSUER}
- LTI_AUTH_URL=${LTI_AUTH_URL}
- LTI_TOKEN_URL=${LTI_TOKEN_URL}
- LTI_KEYSET_URL=${LTI_KEYSET_URL}
- MOODLE_API_URL=${MOODLE_API_URL}
- MOODLE_API_TOKEN=${MOODLE_API_TOKEN}
- ADDRESS_MOODLE=${ADDRESS_MOODLE}
- LTI_CLIENT_ID=${LTI_CLIENT_ID}
- LTI_DEPLOYMENT_ID=${LTI_DEPLOYMENT_ID}
- APP_NAME=${APP_NAME}
- APP_VERSION=${APP_VERSION}
- JWT_ALGORITHM=${JWT_ALGORITHM}
- JWT_EXPIRATION=${JWT_EXPIRATION}
- TOOL_TARGET_LINK_URI=${TOOL_TARGET_LINK_URI}
- TOOL_OIDC_INITIATION_URL=${TOOL_OIDC_INITIATION_URL}
- TOOL_PUBLIC_JWK_URL=${TOOL_PUBLIC_JWK_URL}
networks:
- app-network
- moodle_project_default
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8082/health"]
interval: 30s
timeout: 10s
retries: 3
# Frontend Service
frontend-service:
container_name: frontend-service
image: ${DOCKER_REGISTRY_LOC}/adaptive-learning-frontend:latest
restart: unless-stopped
ports:
- "${FRONTEND_PORT}:5173"
environment:
- VITE_API_BASE_URL=${API_BASE_URL}
- VITE_LTI_SERVICE_URL=${LTI_SERVICE_URL}
- VITE_KONG_GATEWAY_URL=${VITE_KONG_GATEWAY_URL}
- VITE_MOODLE_URL=${VITE_MOODLE_URL}
- VITE_MOODLE_TOKEN=${VITE_MOODLE_TOKEN}
networks:
- app-network
# Course Service
course-service:
container_name: course-service
image: ${DOCKER_REGISTRY_LOC}/course_service:latest
restart: unless-stopped
ports:
- "5001:5001"
environment:
- MONGO_URI=${MONGO_URI}
- MOODLE_API_BASE=${MOODLE_API_BASE}
- MOODLE_TOKEN=${MOODLE_TOKEN}
- ADDRESS_MOODLE=${ADDRESS_MOODLE}
networks:
- app-network
- moodle_project_default
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5001/api/health"]
interval: 30s
timeout: 10s
retries: 3
#Recommendation Service
recommend-service:
container_name: recommend-service
image: ${DOCKER_REGISTRY_LOC}/recommend_service:latest
restart: unless-stopped
ports:
- "8088:8088"
environment:
- MOODLE_URL=${MOODLE_URL_QUESTION_SERVICE}
- MOODLE_CUSTOM_TOKEN=${MOODLE_CUSTOM_TOKEN}
- MOODLE_STANDARD_TOKEN=${MOODLE_STANDARD_TOKEN}
- DEFAULT_COURSE_ID=${DEFAULT_COURSE_ID}
- GEMINI_API_KEY=${USER_CLUSTERS_CSV}
- APIPORT=8088
volumes:
- /home/ubuntu/data:/data
networks:
- app-network
- moodle_project_default
depends_on:
- course-service
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8088/api/health"]
interval: 30s
timeout: 10s
retries: 3
#Question Service
question-service:
container_name: question-service
image: ${DOCKER_REGISTRY_LOC}/question_service:latest
restart: unless-stopped
ports:
- "5003:5003"
environment:
- MONGO_URI=${MONGO_URI:-mongodb+srv://lockbkbang:lHkgnWyAGVSi3CrQ@cluster0.z20xcvv.mongodb.net/questionservice?retryWrites=true&w=majority&appName=Cluster0}
- GEMINI_API_KEY=${GEMINI_API_KEY:-AIzaSyAxNFSQyws7cC9ZnRFKT2rwRU8vT4pXWF8}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- MAX_QUESTIONS_PER_REQUEST=${MAX_QUESTIONS_PER_REQUEST:-100}
- SUPPORTED_QUESTION_TYPES=${SUPPORTED_QUESTION_TYPES:-multichoice,truefalse,shortanswer,essay}
- UPLOAD_FOLDER=${UPLOAD_FOLDER:-/tmp/questionservice}
- MAX_UPLOAD_SIZE=${MAX_UPLOAD_SIZE:-10485760}
- MOODLE_URL=${MOODLE_URL_QUESTION_SERVICE:-http://localhost:8100}
- MOODLE_TOKEN=${TOKEN_PLUGIN_PHP_MOODLE:-88a6b81c5a42e694ef243aac61a0afc1}
- MOODLE_DEFAULT_CATEGORY=${MOODLE_DEFAULT_CATEGORY:-}
- MOODLE_DEFAULT_COURSE_ID=${MOODLE_DEFAULT_COURSE_ID:-5}
volumes:
- /home/ubuntu/data:/data
networks:
- app-network
- moodle_project_default
depends_on:
- course-service
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5003/api/health"]
interval: 30s
timeout: 10s
retries: 3
# Clustering Service
clustering-service:
container_name: clustering-service
image: ${DOCKER_REGISTRY_LOC}/clustering_service:latest
restart: unless-stopped
ports:
- "8089:8089"
environment:
- MOODLE_URL=${MOODLE_API_BASE}
- MOODLE_CUSTOM_TOKEN=${MOODLE_CUSTOM_TOKEN}
- MOODLE_STANDARD_TOKEN=${MOODLE_STANDARD_TOKEN}
- GEMINI_API_KEY=${GEMINI_API_KEY}
- API_PORT=8089
networks:
- app-network
- moodle_project_default
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8089/api/health"]
interval: 30s
timeout: 10s
retries: 3
networks:
app-network:
driver: bridge
moodle_project_default:
external: true