cic-staff-client/Dockerfile

36 lines
681 B
Docker
Raw Permalink Normal View History

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 . .
2021-08-13 23:51:30 +02:00
ARG FRONTEND_ENV=prod
2020-12-28 11:31:35 +01:00
# 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;" ]