Skip to content

Commit d1cbf26

Browse files
committedMay 2, 2024
Add mongo dependency for chatbot
1 parent 895c01a commit d1cbf26

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed
 

‎deploy/docker/docker-compose.yml

+3
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ services:
162162
- MONGO_DB_PASSWORD=crapisecretpassword
163163
- MONGO_DB_NAME=crapi
164164
# - CHATBOT_OPENAI_API_KEY=
165+
depends_on:
166+
mongodb:
167+
condition: service_healthy
165168
# ports:
166169
# - "${LISTEN_IP:-127.0.0.1}:5002:5002"
167170

‎deploy/helm/templates/chatbot/deployment.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ spec:
2020
{{- toYaml . | nindent 8 }}
2121
{{- end }}
2222
spec:
23+
initContainers:
24+
- name: wait-for-mongo
25+
image: {{ .Values.waitForK8sResources.image }}
26+
imagePullPolicy: {{ .Values.waitForK8sResources.imagePullPolicy }}
27+
args:
28+
- "service"
29+
- {{ .Values.mongodb.service.name | quote }}
2330
containers:
2431
- name: {{ .Values.chatbot.name }}
2532
image: {{ .Values.chatbot.image }}:{{ .Chart.AppVersion }}

‎services/web/nginx.conf.template

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ server {
2222
proxy_pass ${HTTP_PROTOCOL}://${COMMUNITY_SERVICE};
2323
proxy_set_header Host ${COMMUNITY_SERVICE};
2424
proxy_set_header X-Forwarded-Host $http_host;
25-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
25+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2626
sub_filter_types application/json text/html;
2727
sub_filter "://${COMMUNITY_SERVICE}" "://$http_host";
2828
sub_filter_once off;
@@ -40,7 +40,7 @@ server {
4040
proxy_pass ${HTTP_PROTOCOL}://${IDENTITY_SERVICE};
4141
proxy_set_header Host ${IDENTITY_SERVICE};
4242
proxy_set_header X-Forwarded-Host $http_host;
43-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
43+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
4444
}
4545

4646
location /workshop/ {
@@ -55,7 +55,7 @@ server {
5555
proxy_pass ${HTTP_PROTOCOL}://${WORKSHOP_SERVICE};
5656
proxy_set_header Host ${WORKSHOP_SERVICE};
5757
proxy_set_header X-Forwarded-Host $http_host;
58-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
58+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
5959
sub_filter_types application/json text/html;
6060
sub_filter "${HTTP_PROTOCOL}://${WORKSHOP_SERVICE}" "$scheme://$http_host";
6161
sub_filter_once off;
@@ -73,7 +73,7 @@ server {
7373
proxy_pass ${HTTP_PROTOCOL}://${CHATBOT_SERVICE};
7474
proxy_set_header Host ${CHATBOT_SERVICE};
7575
proxy_set_header X-Forwarded-Host $http_host;
76-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
76+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
7777
sub_filter_types application/json text/html;
7878
sub_filter "://${CHATBOT_SERVICE}" "://$http_host";
7979
sub_filter_once off;
@@ -116,7 +116,7 @@ server {
116116
proxy_pass ${HTTP_PROTOCOL}://${COMMUNITY_SERVICE};
117117
proxy_set_header Host ${COMMUNITY_SERVICE};
118118
proxy_set_header X-Forwarded-Host $http_host;
119-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
119+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
120120
sub_filter_types application/json text/html;
121121
sub_filter "://${COMMUNITY_SERVICE}" "://$http_host";
122122
sub_filter_once off;
@@ -134,7 +134,7 @@ server {
134134
proxy_pass ${HTTP_PROTOCOL}://${IDENTITY_SERVICE};
135135
proxy_set_header Host ${IDENTITY_SERVICE};
136136
proxy_set_header X-Forwarded-Host $http_host;
137-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
137+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
138138
}
139139

140140
location /workshop/ {
@@ -149,7 +149,7 @@ server {
149149
proxy_pass ${HTTP_PROTOCOL}://${WORKSHOP_SERVICE};
150150
proxy_set_header Host ${WORKSHOP_SERVICE};
151151
proxy_set_header X-Forwarded-Host $http_host;
152-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
152+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
153153
sub_filter_types application/json text/html;
154154
sub_filter "${HTTP_PROTOCOL}://${WORKSHOP_SERVICE}" "$scheme://$http_host";
155155
sub_filter_once off;
@@ -167,7 +167,7 @@ server {
167167
proxy_pass ${HTTP_PROTOCOL}://${CHATBOT_SERVICE};
168168
proxy_set_header Host ${CHATBOT_SERVICE};
169169
proxy_set_header X-Forwarded-Host $http_host;
170-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
170+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
171171
sub_filter_types application/json text/html;
172172
sub_filter "${HTTP_PROTOCOL}://${CHATBOT_SERVICE}" "$scheme://$http_host";
173173
sub_filter_once off;

‎services/web/nginx.ssl.conf.template

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ server {
2121
proxy_pass ${HTTP_PROTOCOL}://${COMMUNITY_SERVICE};
2222
proxy_set_header Host ${COMMUNITY_SERVICE};
2323
proxy_set_header X-Forwarded-Host $http_host;
24-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
24+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2525
sub_filter_types application/json text/html;
2626
sub_filter "${HTTP_PROTOCOL}://${COMMUNITY_SERVICE}" "$scheme://$http_host";
2727
sub_filter_once off;
@@ -41,7 +41,7 @@ server {
4141
proxy_pass ${HTTP_PROTOCOL}://${IDENTITY_SERVICE};
4242
proxy_set_header Host ${IDENTITY_SERVICE};
4343
proxy_set_header X-Forwarded-Host $http_host;
44-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
44+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
4545
proxy_ssl_verify off;
4646
proxy_ssl_trusted_certificate /app/certs/server.crt;
4747
}
@@ -58,7 +58,7 @@ server {
5858
proxy_pass ${HTTP_PROTOCOL}://${WORKSHOP_SERVICE};
5959
proxy_set_header Host ${WORKSHOP_SERVICE};
6060
proxy_set_header X-Forwarded-Host $http_host;
61-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
61+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
6262
sub_filter_types application/json text/html;
6363
sub_filter "${HTTP_PROTOCOL}://${WORKSHOP_SERVICE}" "$scheme://$http_host";
6464
sub_filter_once off;
@@ -78,7 +78,7 @@ server {
7878
proxy_pass ${HTTP_PROTOCOL}://${CHATBOT_SERVICE};
7979
proxy_set_header Host ${CHATBOT_SERVICE};
8080
proxy_set_header X-Forwarded-Host $http_host;
81-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
81+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
8282
sub_filter_types application/json text/html;
8383
sub_filter "${HTTP_PROTOCOL}://${CHATBOT_SERVICE}" "$scheme://$http_host";
8484
sub_filter_once off;
@@ -125,7 +125,7 @@ server {
125125
proxy_pass ${HTTP_PROTOCOL}://${COMMUNITY_SERVICE};
126126
proxy_set_header Host ${COMMUNITY_SERVICE};
127127
proxy_set_header X-Forwarded-Host $http_host;
128-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
128+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
129129
sub_filter_types application/json text/html;
130130
sub_filter "${HTTP_PROTOCOL}://${COMMUNITY_SERVICE}" "$scheme://$http_host";
131131
sub_filter_once off;
@@ -143,7 +143,7 @@ server {
143143
proxy_pass ${HTTP_PROTOCOL}://${IDENTITY_SERVICE};
144144
proxy_set_header Host ${IDENTITY_SERVICE};
145145
proxy_set_header X-Forwarded-Host $http_host;
146-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
146+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
147147
}
148148

149149
location /workshop/ {
@@ -158,7 +158,7 @@ server {
158158
proxy_pass ${HTTP_PROTOCOL}://${WORKSHOP_SERVICE};
159159
proxy_set_header Host ${WORKSHOP_SERVICE};
160160
proxy_set_header X-Forwarded-Host $http_host;
161-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
161+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
162162
sub_filter_types application/json text/html;
163163
sub_filter "${HTTP_PROTOCOL}://${WORKSHOP_SERVICE}" "$scheme://$http_host";
164164
sub_filter_once off;
@@ -176,7 +176,7 @@ server {
176176
proxy_pass ${HTTP_PROTOCOL}://${CHATBOT_SERVICE};
177177
proxy_set_header Host ${CHATBOT_SERVICE};
178178
proxy_set_header X-Forwarded-Host $http_host;
179-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
179+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
180180
sub_filter_types application/json text/html;
181181
sub_filter "://${CHATBOT_SERVICE}" "://$http_host";
182182
sub_filter_once off;

0 commit comments

Comments
 (0)
Failed to load comments.