Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# SPDX-License-Identifier: Apache-2.0

#!/bin/sh
envsubst '${FRONTEND_SERVICE_IP} ${FRONTEND_SERVICE_PORT} ${BACKEND_SERVICE_NAME} ${BACKEND_SERVICE_IP} ${BACKEND_SERVICE_PORT} ${DATAPREP_SERVICE_IP} ${DATAPREP_SERVICE_PORT}' < /etc/nginx/nginx.conf.template > /etc/nginx/conf.d/default.conf
envsubst '${NGINX_PORT} ${FRONTEND_SERVICE_IP} ${FRONTEND_SERVICE_PORT} ${BACKEND_SERVICE_NAME} ${BACKEND_SERVICE_IP} ${BACKEND_SERVICE_PORT} ${DATAPREP_SERVICE_IP} ${DATAPREP_SERVICE_PORT}' < /etc/nginx/nginx.conf.template > /etc/nginx/conf.d/default.conf
nginx -g 'daemon off;'
8 changes: 5 additions & 3 deletions comps/third_parties/nginx/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
# SPDX-License-Identifier: Apache-2.0


FROM nginx:alpine

RUN apk add --no-cache gettext
FROM nginxinc/nginx-unprivileged
USER root
RUN apt-get update && apt-get install -y gettext && apt-get clean
#RUN apk add --no-cache gettext

COPY comps/third_parties/nginx/src/nginx.conf.template /etc/nginx/nginx.conf.template

ENV NGINX_PORT=8080
ENV FRONTEND_SERVICE_IP=localhost
ENV FRONTEND_SERVICE_PORT=5173
ENV BACKEND_SERVICE_NAME=chatqna
Expand Down
4 changes: 2 additions & 2 deletions comps/third_parties/nginx/src/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@


server {
listen 80;
listen [::]:80;
listen ${NGINX_PORT};
listen [::]:${NGINX_PORT};

location /home {
alias /usr/share/nginx/html/index.html;
Expand Down
2 changes: 1 addition & 1 deletion tests/third_parties/test_third_parties_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function start_service() {
export NGINX_PORT=80

# Start Docker Containers
docker run -d --name test-comps-nginx-server -p 80:80 opea/nginx:comps
docker run -d --name test-comps-nginx-server -p ${NGINX_PORT}:8080 -e NGINX_PORT=8080 opea/nginx:comps

sleep 5s
}
Expand Down