Skip to content
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
1 change: 1 addition & 0 deletions ui/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
17 changes: 17 additions & 0 deletions ui/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# stage1 - build react app first
FROM node:14.16.0-alpine3.10 as build
WORKDIR /app_ui
ENV PATH /app/node_modules/.bin:$PATH
COPY ./package.json /app_ui/
COPY ./yarn.lock /app_ui/
RUN yarn
COPY . /app_ui
RUN yarn build

# stage 2 - build the final image and copy the react build files
FROM nginx:1.18.0-alpine
COPY --from=build /app_ui/build /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/conf.d
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
18 changes: 18 additions & 0 deletions ui/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
server {
listen 80;

location / {
root /usr/share/nginx/html;
index /index.html index.htm;

# to redirect all the requests to index.html, useful when using react-router

try_files $uri /index.html;
}

error_page 500 502 503 504 /50x.html;

location = /50x.html {
root /usr/share/nginx/html;
}
}
Empty file added ui/yarn.lock
Empty file.