Skip to content

Nginx Root User and Port issue Fix: ProductivitySuite #1893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions ProductivitySuite/docker_compose/intel/cpu/xeon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,6 @@ export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
export LLM_MODEL_ID_CODEGEN="meta-llama/CodeLlama-7b-hf"
export INDEX_NAME="rag-redis"
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
export BACKEND_SERVICE_ENDPOINT_CHATQNA="http://${host_ip}:8888/v1/chatqna"
export DATAPREP_DELETE_FILE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/delete"
export BACKEND_SERVICE_ENDPOINT_CODEGEN="http://${host_ip}:7778/v1/codegen"
export BACKEND_SERVICE_ENDPOINT_DOCSUM="http://${host_ip}:8890/v1/docsum"
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/ingest"
export DATAPREP_GET_FILE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/get"
export CHAT_HISTORY_CREATE_ENDPOINT="http://${host_ip}:6012/v1/chathistory/create"
export CHAT_HISTORY_CREATE_ENDPOINT="http://${host_ip}:6012/v1/chathistory/create"
export CHAT_HISTORY_DELETE_ENDPOINT="http://${host_ip}:6012/v1/chathistory/delete"
export CHAT_HISTORY_GET_ENDPOINT="http://${host_ip}:6012/v1/chathistory/get"
export PROMPT_SERVICE_GET_ENDPOINT="http://${host_ip}:6018/v1/prompt/get"
export PROMPT_SERVICE_CREATE_ENDPOINT="http://${host_ip}:6018/v1/prompt/create"
export PROMPT_SERVICE_DELETE_ENDPOINT="http://${host_ip}:6018/v1/prompt/delete"
export KEYCLOAK_SERVICE_ENDPOINT="http://${host_ip}:8080"
export DocSum_COMPONENT_NAME="OpeaDocSumTgi"

#Set no proxy
Expand Down Expand Up @@ -411,7 +397,7 @@ Please refer to **[keycloak_setup_guide](keycloak_setup_guide.md)** for more det

## 🚀 Launch the UI

To access the frontend, open the following URL in your browser: http://{host_ip}:5174. By default, the UI runs on port 80 internally. If you prefer to use a different host port to access the frontend, you can modify the port mapping in the `compose.yaml` file as shown below:
To access the frontend, open the following URL in your browser: http://{host_ip}. By default, the UI runs on port 80 internally. Nginx server will route the calls to appropriate services based on the routes. If you prefer to use a different host port to access the frontend, you can modify the port mapping in the `compose.yaml` file as shown below:

```yaml
productivity-suite-xeon-react-ui-server:
Expand Down
51 changes: 38 additions & 13 deletions ProductivitySuite/docker_compose/intel/cpu/xeon/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ services:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
- KC_PROXY=edge
- KC_HTTP_RELATIVE_PATH=/keycloak/
ipc: host
command: start-dev
restart: always
Expand All @@ -271,23 +272,47 @@ services:
ports:
- "5174:80"
environment:
- APP_BACKEND_SERVICE_ENDPOINT_CHATQNA=${BACKEND_SERVICE_ENDPOINT_CHATQNA}
- APP_BACKEND_SERVICE_ENDPOINT_CODEGEN=${BACKEND_SERVICE_ENDPOINT_CODEGEN}
- APP_BACKEND_SERVICE_ENDPOINT_DOCSUM=${BACKEND_SERVICE_ENDPOINT_DOCSUM}
- APP_DATAPREP_SERVICE_ENDPOINT=${DATAPREP_SERVICE_ENDPOINT}
- APP_DATAPREP_GET_FILE_ENDPOINT=${DATAPREP_GET_FILE_ENDPOINT}
- APP_DATAPREP_DELETE_FILE_ENDPOINT=${DATAPREP_DELETE_FILE_ENDPOINT}
- APP_CHAT_HISTORY_CREATE_ENDPOINT=${CHAT_HISTORY_CREATE_ENDPOINT}
- APP_CHAT_HISTORY_DELETE_ENDPOINT=${CHAT_HISTORY_DELETE_ENDPOINT}
- APP_CHAT_HISTORY_GET_ENDPOINT=${CHAT_HISTORY_GET_ENDPOINT}
- APP_PROMPT_SERVICE_GET_ENDPOINT=${PROMPT_SERVICE_GET_ENDPOINT}
- APP_PROMPT_SERVICE_CREATE_ENDPOINT=${PROMPT_SERVICE_CREATE_ENDPOINT}
- APP_PROMPT_SERVICE_DELETE_ENDPOINT=${PROMPT_SERVICE_DELETE_ENDPOINT}
- APP_KEYCLOAK_SERVICE_ENDPOINT=${KEYCLOAK_SERVICE_ENDPOINT}
- LOGFLAG=${LOGFLAG}
ipc: host
restart: always

productivity-suite-nginx-server:
image: ${REGISTRY:-opea}/nginx:${TAG:-latest}
container_name: productivity-suite-nginx-server
depends_on:
- chatqna-xeon-backend-server
- productivity-suite-xeon-react-ui-server
ports:
- "${NGINX_PORT:-80}:80"
environment:
- no_proxy=${no_proxy}
- https_proxy=${https_proxy}
- http_proxy=${http_proxy}
- FRONTEND_SERVICE_IP=productivity-suite-xeon-react-ui-server
- FRONTEND_SERVICE_PORT=80
- BACKEND_SERVICE_NAME=chatqna
- BACKEND_SERVICE_IP=chatqna-xeon-backend-server
- BACKEND_SERVICE_PORT=8888
- DATAPREP_SERVICE_IP=dataprep-redis-service
- DATAPREP_SERVICE_PORT=5000
- BACKEND_CODEGEN_SERVICE_NAME=codegen
- BACKEND_CODEGEN_SERVICE_IP=codegen-xeon-backend-server
- BACKEND_CODEGEN_SERVICE_PORT=7778
- BACKEND_DOCSUM_SERVICE_NAME=docsum
- BACKEND_DOCSUM_SERVICE_IP=docsum-xeon-backend-server
- BACKEND_DOCSUM_SERVICE_PORT=8888
- BACKEND_CHAT_HISTORY_SERVICE_NAME=chathistory
- BACKEND_CHAT_HISTORY_SERVICE_IP=chathistory-mongo
- BACKEND_CHAT_HISTORY_SERVICE_PORT=6012
- BACKEND_PROMPT_SERVICE_NAME=prompt
- BACKEND_PROMPT_SERVICE_IP=promptregistry-mongo
- BACKEND_PROMPT_SERVICE_PORT=6018
- KEYCLOAK_SERVICE_NAME=keycloak
- KEYCLOAK_SERVICE_IP=keycloak
- KEYCLOAK_SERVICE_PORT=8080
ipc: host
restart: always

llm-docsum-tgi:
image: ${REGISTRY:-opea}/llm-docsum:${TAG:-latest}
container_name: docsum-xeon-llm-server
Expand Down
14 changes: 0 additions & 14 deletions ProductivitySuite/docker_compose/intel/cpu/xeon/set_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
export LLM_MODEL_ID_CODEGEN="Intel/neural-chat-7b-v3-3"
export INDEX_NAME="rag-redis"
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
export BACKEND_SERVICE_ENDPOINT_CHATQNA="http://${host_ip}:8888/v1/chatqna"
export DATAPREP_DELETE_FILE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/delete"
export BACKEND_SERVICE_ENDPOINT_CODEGEN="http://${host_ip}:7778/v1/codegen"
export BACKEND_SERVICE_ENDPOINT_DOCSUM="http://${host_ip}:8890/v1/docsum"
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/ingest"
export DATAPREP_GET_FILE_ENDPOINT="http://${host_ip}:6007/v1/dataprep/get"
export CHAT_HISTORY_CREATE_ENDPOINT="http://${host_ip}:6012/v1/chathistory/create"
export CHAT_HISTORY_CREATE_ENDPOINT="http://${host_ip}:6012/v1/chathistory/create"
export CHAT_HISTORY_DELETE_ENDPOINT="http://${host_ip}:6012/v1/chathistory/delete"
export CHAT_HISTORY_GET_ENDPOINT="http://${host_ip}:6012/v1/chathistory/get"
export PROMPT_SERVICE_GET_ENDPOINT="http://${host_ip}:6018/v1/prompt/get"
export PROMPT_SERVICE_CREATE_ENDPOINT="http://${host_ip}:6018/v1/prompt/create"
export PROMPT_SERVICE_DELETE_ENDPOINT="http://${host_ip}:6018/v1/prompt/delete"
export KEYCLOAK_SERVICE_ENDPOINT="http://${host_ip}:8080"
export DocSum_COMPONENT_NAME="OpeaDocSumTgi"

#Set no proxy
Expand Down
7 changes: 2 additions & 5 deletions ProductivitySuite/ui/docker/Dockerfile.react
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ WORKDIR /usr/app/react
RUN ["npm", "install"]
RUN ["npm", "run", "build"]


FROM nginx:alpine
FROM nginxinc/nginx-unprivileged:alpine3.18-slim

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
CMD ["nginx", "-g", "daemon off;"]
27 changes: 14 additions & 13 deletions ProductivitySuite/ui/react/.env.production
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
VITE_BACKEND_SERVICE_ENDPOINT_CHATQNA=APP_BACKEND_SERVICE_ENDPOINT_CHATQNA
VITE_BACKEND_SERVICE_ENDPOINT_CODEGEN=APP_BACKEND_SERVICE_ENDPOINT_CODEGEN
VITE_BACKEND_SERVICE_ENDPOINT_DOCSUM=APP_BACKEND_SERVICE_ENDPOINT_DOCSUM
VITE_KEYCLOAK_SERVICE_ENDPOINT=APP_KEYCLOAK_SERVICE_ENDPOINT
VITE_BACKEND_SERVICE_ENDPOINT_CHATQNA=/v1/chatqna
VITE_BACKEND_SERVICE_ENDPOINT_CODEGEN=/v1/codegen
VITE_BACKEND_SERVICE_ENDPOINT_DOCSUM=/v1/docsum
VITE_KEYCLOAK_SERVICE_ENDPOINT=/keycloak


VITE_DATAPREP_SERVICE_ENDPOINT=APP_DATAPREP_SERVICE_ENDPOINT
VITE_DATAPREP_GET_FILE_ENDPOINT=APP_DATAPREP_GET_FILE_ENDPOINT
VITE_DATAPREP_DELETE_FILE_ENDPOINT=APP_DATAPREP_DELETE_FILE_ENDPOINT
VITE_DATAPREP_SERVICE_ENDPOINT=/v1/dataprep/ingest
VITE_DATAPREP_GET_FILE_ENDPOINT=/v1/dataprep/get
VITE_DATAPREP_DELETE_FILE_ENDPOINT=/v1/dataprep/delete

VITE_CHAT_HISTORY_CREATE_ENDPOINT=/v1/chathistory/create
VITE_CHAT_HISTORY_GET_ENDPOINT=/v1/chathistory/get
VITE_CHAT_HISTORY_DELETE_ENDPOINT=/v1/chathistory/delete
VITE_PROMPT_SERVICE_GET_ENDPOINT=/v1/prompt/get
VITE_PROMPT_SERVICE_CREATE_ENDPOINT=/v1/prompt/create
VITE_PROMPT_SERVICE_DELETE_ENDPOINT=/v1/prompt/delete

VITE_CHAT_HISTORY_CREATE_ENDPOINT=APP_CHAT_HISTORY_CREATE_ENDPOINT
VITE_CHAT_HISTORY_GET_ENDPOINT=APP_CHAT_HISTORY_GET_ENDPOINT
VITE_CHAT_HISTORY_DELETE_ENDPOINT=APP_CHAT_HISTORY_DELETE_ENDPOINT
VITE_PROMPT_SERVICE_GET_ENDPOINT=APP_PROMPT_SERVICE_GET_ENDPOINT
VITE_PROMPT_SERVICE_CREATE_ENDPOINT=APP_PROMPT_SERVICE_CREATE_ENDPOINT
VITE_PROMPT_SERVICE_DELETE_ENDPOINT=APP_PROMPT_SERVICE_DELETE_ENDPOINT
15 changes: 0 additions & 15 deletions ProductivitySuite/ui/react/env.sh

This file was deleted.

2 changes: 1 addition & 1 deletion ProductivitySuite/ui/react/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ProductivitySuite",
"name": "productivitysuite",
"version": "0.0.1",
"description": "ProductivitySuite UI - OPEA",
"homepage": ".",
Expand Down
Loading