diff --git a/ChatQnA/docker/ui/docker/Dockerfile.react b/ChatQnA/docker/ui/docker/Dockerfile.react index f023b7afbc..eca756f69e 100644 --- a/ChatQnA/docker/ui/docker/Dockerfile.react +++ b/ChatQnA/docker/ui/docker/Dockerfile.react @@ -15,7 +15,6 @@ RUN ["npm", "run", "build"] FROM nginx:alpine COPY --from=vite-app /usr/app/react/dist /usr/share/nginx/html -COPY ./react/env.sh /docker-entrypoint.d/env.sh -COPY ./react/nginx.conf /etc/nginx/conf.d/default.conf -RUN chmod +x /docker-entrypoint.d/env.sh \ No newline at end of file +COPY ./react/nginx.conf /tmp/nginx.conf +ENTRYPOINT envsubst < /tmp/nginx.conf > /etc/nginx/conf.d/default.conf && /usr/sbin/nginx -g "daemon off;" diff --git a/ChatQnA/docker/ui/react/.env.production b/ChatQnA/docker/ui/react/.env.production index a46e1e3850..d5bcd04858 100644 --- a/ChatQnA/docker/ui/react/.env.production +++ b/ChatQnA/docker/ui/react/.env.production @@ -1,2 +1,2 @@ -VITE_BACKEND_SERVICE_ENDPOINT=APP_BACKEND_SERVICE_ENDPOINT -VITE_DATA_PREP_SERVICE_URL=APP_DATA_PREP_SERVICE_URL \ No newline at end of file +VITE_BACKEND_SERVICE_ENDPOINT=/v1/chatqna +VITE_DATA_PREP_SERVICE_URL=/v1/dataprep \ No newline at end of file diff --git a/ChatQnA/docker/ui/react/env.sh b/ChatQnA/docker/ui/react/env.sh deleted file mode 100644 index ce1372ea68..0000000000 --- a/ChatQnA/docker/ui/react/env.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -for i in $(env | grep APP_) #// Make sure to use the prefix MY_APP_ if you have any other prefix in env.production file variable name replace it with MY_APP_ -do - key=$(echo $i | cut -d '=' -f 1) - value=$(echo $i | cut -d '=' -f 2-) - echo $key=$value - # sed All files - # find /usr/share/nginx/html -type f -exec sed -i "s|${key}|${value}|g" '{}' + - - # sed JS and CSS only - find /usr/share/nginx/html -type f \( -name '*.js' -o -name '*.css' \) -exec sed -i "s|${key}|${value}|g" '{}' + -done diff --git a/ChatQnA/docker/ui/react/nginx.conf b/ChatQnA/docker/ui/react/nginx.conf index 00433fcda7..d82cae56cf 100644 --- a/ChatQnA/docker/ui/react/nginx.conf +++ b/ChatQnA/docker/ui/react/nginx.conf @@ -16,5 +16,13 @@ server { location ~* \.(gif|jpe?g|png|webp|ico|svg|css|js|mp4|woff2)$ { expires 1d; } + + location "/v1/chatqna" { + proxy_pass $CHAT_BASE_URL; + } + + location "/v1/dataprep" { + proxy_pass $UPLOAD_FILE_BASE_URL; + } } } \ No newline at end of file