2020-12-28 11:31:35 +01:00
|
|
|
# defining version of the base image
|
2020-12-28 12:43:53 +01:00
|
|
|
FROM node:alpine as build
|
2020-12-28 11:31:35 +01:00
|
|
|
|
|
|
|
# defining work directory
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# copying the json files into the image
|
2021-04-10 21:17:16 +02:00
|
|
|
COPY package*.json .
|
|
|
|
COPY patch-webpack.js .
|
2020-12-28 11:31:35 +01:00
|
|
|
|
|
|
|
RUN npm install
|
|
|
|
# copying rest of project
|
2021-04-10 21:17:16 +02:00
|
|
|
|
2020-12-28 11:31:35 +01:00
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# running build script
|
2021-08-13 23:42:59 +02:00
|
|
|
RUN npm run build:${FRONTEND_ENV}
|
2020-12-28 11:31:35 +01:00
|
|
|
|
|
|
|
### STAGE 2: Setup ###
|
|
|
|
# defining nginx image version
|
2020-12-28 12:43:53 +01:00
|
|
|
FROM nginx:alpine
|
2020-12-28 11:31:35 +01:00
|
|
|
|
|
|
|
## Remove default nginx website
|
|
|
|
RUN rm -rf /usr/share/nginx/html/*
|
|
|
|
|
|
|
|
# copy dist output from our first image
|
|
|
|
COPY --from=build /app/dist/cic-staff-client /usr/share/nginx/html
|
|
|
|
|
|
|
|
# copy nginx configuration file
|
2021-04-10 21:17:16 +02:00
|
|
|
COPY nginx.conf /etc/nginx/
|
2020-12-28 11:31:35 +01:00
|
|
|
|
2021-04-10 21:17:16 +02:00
|
|
|
EXPOSE 80
|
2020-12-28 11:31:35 +01:00
|
|
|
|
|
|
|
CMD [ "nginx", "-g", "daemon off;" ]
|