-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1053 from ORCID/feature/mserve-ui-container-add-n…
…ginx Feature/mserve UI container add nginx
- Loading branch information
Showing
6 changed files
with
78 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,41 @@ | ||
FROM node:20.7.0-bullseye-slim | ||
FROM node:20.7.0-bullseye-slim AS ui-build-stage | ||
|
||
# Create app directory | ||
WORKDIR /app | ||
|
||
# Install some useful utils for debug/test | ||
RUN \ | ||
apt-get update && \ | ||
apt -y install procps iproute2 net-tools curl iputils-ping vim && \ | ||
apt -y install python3 make gcc g++ && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install app dependencies | ||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
# where available (npm@5+) | ||
COPY package*.json ./ | ||
|
||
COPY container-files/* /var/tmp/ | ||
|
||
RUN \ | ||
chmod +x /var/tmp/* && \ | ||
npm install | ||
|
||
# If you are building your code for production | ||
# RUN npm install --only=production | ||
RUN npm install | ||
|
||
# Bundle app source | ||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
EXPOSE 4200 | ||
FROM nginx | ||
|
||
RUN \ | ||
apt-get update && \ | ||
apt -y install procps vim && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY container-files/etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf | ||
|
||
# Copy files from the ui-build-stage into this new nginx stage | ||
COPY --from=ui-build-stage /app/dist/ /usr/share/nginx/html/ | ||
|
||
EXPOSE 8090 | ||
|
||
ENTRYPOINT /var/tmp/entrypoint.sh | ||
# Use the underlying ENTRYPOINT and CMD provided by the base NGINX image | ||
#ENTRYPOINT /var/tmp/entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
server { | ||
listen 8090; | ||
server_name localhost; | ||
|
||
#access_log /var/log/nginx/host.access.log main; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
rewrite ^/ui/(.*) /$1 break; | ||
} | ||
|
||
# JT. Uncomment the error_page directive below to use the orcid 404 error page in /404 | ||
#error_page 404 ../404; | ||
|
||
# redirect server error pages to the static page /50x.html | ||
# | ||
#error_page 500 502 503 504 /50x.html; | ||
#location = /50x.html { | ||
# root /usr/share/nginx/html; | ||
#} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
user nginx; | ||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log notice; | ||
pid /var/run/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
|
||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
} |