cic-staff-client/Dockerfile

35 lines
647 B
Docker
Raw 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 . .
# running build script
2021-04-17 01:26:42 +02:00
RUN npm run build:dev
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;" ]