Skip to content

Commit

Permalink
Add mongo dependency for chatbot
Browse files Browse the repository at this point in the history
  • Loading branch information
piyushroshan committed May 2, 2024
1 parent 895c01a commit d1cbf26
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
3 changes: 3 additions & 0 deletions deploy/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ services:
- MONGO_DB_PASSWORD=crapisecretpassword
- MONGO_DB_NAME=crapi
# - CHATBOT_OPENAI_API_KEY=
depends_on:
mongodb:
condition: service_healthy
# ports:
# - "${LISTEN_IP:-127.0.0.1}:5002:5002"

Expand Down
7 changes: 7 additions & 0 deletions deploy/helm/templates/chatbot/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
initContainers:
- name: wait-for-mongo
image: {{ .Values.waitForK8sResources.image }}
imagePullPolicy: {{ .Values.waitForK8sResources.imagePullPolicy }}
args:
- "service"
- {{ .Values.mongodb.service.name | quote }}
containers:
- name: {{ .Values.chatbot.name }}
image: {{ .Values.chatbot.image }}:{{ .Chart.AppVersion }}
Expand Down
16 changes: 8 additions & 8 deletions services/web/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${COMMUNITY_SERVICE};
proxy_set_header Host ${COMMUNITY_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "://${COMMUNITY_SERVICE}" "://$http_host";
sub_filter_once off;
Expand All @@ -40,7 +40,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${IDENTITY_SERVICE};
proxy_set_header Host ${IDENTITY_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /workshop/ {
Expand All @@ -55,7 +55,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${WORKSHOP_SERVICE};
proxy_set_header Host ${WORKSHOP_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "${HTTP_PROTOCOL}://${WORKSHOP_SERVICE}" "$scheme://$http_host";
sub_filter_once off;
Expand All @@ -73,7 +73,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${CHATBOT_SERVICE};
proxy_set_header Host ${CHATBOT_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "://${CHATBOT_SERVICE}" "://$http_host";
sub_filter_once off;
Expand Down Expand Up @@ -116,7 +116,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${COMMUNITY_SERVICE};
proxy_set_header Host ${COMMUNITY_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "://${COMMUNITY_SERVICE}" "://$http_host";
sub_filter_once off;
Expand All @@ -134,7 +134,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${IDENTITY_SERVICE};
proxy_set_header Host ${IDENTITY_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /workshop/ {
Expand All @@ -149,7 +149,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${WORKSHOP_SERVICE};
proxy_set_header Host ${WORKSHOP_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "${HTTP_PROTOCOL}://${WORKSHOP_SERVICE}" "$scheme://$http_host";
sub_filter_once off;
Expand All @@ -167,7 +167,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${CHATBOT_SERVICE};
proxy_set_header Host ${CHATBOT_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "${HTTP_PROTOCOL}://${CHATBOT_SERVICE}" "$scheme://$http_host";
sub_filter_once off;
Expand Down
16 changes: 8 additions & 8 deletions services/web/nginx.ssl.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${COMMUNITY_SERVICE};
proxy_set_header Host ${COMMUNITY_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "${HTTP_PROTOCOL}://${COMMUNITY_SERVICE}" "$scheme://$http_host";
sub_filter_once off;
Expand All @@ -41,7 +41,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${IDENTITY_SERVICE};
proxy_set_header Host ${IDENTITY_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ssl_verify off;
proxy_ssl_trusted_certificate /app/certs/server.crt;
}
Expand All @@ -58,7 +58,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${WORKSHOP_SERVICE};
proxy_set_header Host ${WORKSHOP_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "${HTTP_PROTOCOL}://${WORKSHOP_SERVICE}" "$scheme://$http_host";
sub_filter_once off;
Expand All @@ -78,7 +78,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${CHATBOT_SERVICE};
proxy_set_header Host ${CHATBOT_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "${HTTP_PROTOCOL}://${CHATBOT_SERVICE}" "$scheme://$http_host";
sub_filter_once off;
Expand Down Expand Up @@ -125,7 +125,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${COMMUNITY_SERVICE};
proxy_set_header Host ${COMMUNITY_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "${HTTP_PROTOCOL}://${COMMUNITY_SERVICE}" "$scheme://$http_host";
sub_filter_once off;
Expand All @@ -143,7 +143,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${IDENTITY_SERVICE};
proxy_set_header Host ${IDENTITY_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /workshop/ {
Expand All @@ -158,7 +158,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${WORKSHOP_SERVICE};
proxy_set_header Host ${WORKSHOP_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "${HTTP_PROTOCOL}://${WORKSHOP_SERVICE}" "$scheme://$http_host";
sub_filter_once off;
Expand All @@ -176,7 +176,7 @@ server {
proxy_pass ${HTTP_PROTOCOL}://${CHATBOT_SERVICE};
proxy_set_header Host ${CHATBOT_SERVICE};
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter_types application/json text/html;
sub_filter "://${CHATBOT_SERVICE}" "://$http_host";
sub_filter_once off;
Expand Down

0 comments on commit d1cbf26

Please sign in to comment.