Skip to content
Snippets Groups Projects
Commit fac73440 authored by Imre Toth's avatar Imre Toth
Browse files

Building, and serving web UI via NGINX

parent fcac211d
No related branches found
No related tags found
1 merge request!52Building, and serving web UI via NGINX
Pipeline #88960 passed
FROM node:alpine # build CCCE Frontend
MAINTAINER John Sparger FROM node:14.15.4 as builder
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
ENV PATH /usr/src/app/node_modules/.bin:$PATH
COPY package.json /usr/src/app/
RUN npm install
RUN npm install react-scripts@4.0.1 -g
COPY . /usr/src/app
ENV PUBLIC_URL "/"
ENV REACT_APP_LOGIN_METHOD "STD"
RUN npm run build
RUN mkdir /web # production environment
WORKDIR /web FROM nginx:1.19.6-alpine
RUN rm -rf /etc/nginx/conf.d
RUN mkdir /etc/nginx/conf.d
COPY docker/default.conf /etc/nginx/conf.d
COPY --from=builder /usr/src/app/build /usr/share/nginx/html/
EXPOSE 8080 EXPOSE 8080
CMD PORT=8080 /usr/local/bin/npm start CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file \ No newline at end of file
server {
listen 8080;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment