2022-06-13 17:28:56 +00:00
|
|
|
FROM node:lts-buster as build
|
2022-06-11 00:22:47 +00:00
|
|
|
|
2022-06-13 17:28:56 +00:00
|
|
|
# Create app directory
|
|
|
|
WORKDIR /usr/src/app
|
2022-06-11 00:22:47 +00:00
|
|
|
|
2022-06-13 17:28:56 +00:00
|
|
|
# Copy dependency definitions
|
|
|
|
COPY package.json /usr/src/app
|
|
|
|
COPY package-lock.json /usr/src/app
|
2022-06-11 00:22:47 +00:00
|
|
|
|
2022-06-13 20:38:14 +00:00
|
|
|
# Install dependencies
|
2022-06-13 17:28:56 +00:00
|
|
|
#RUN npm set progress=false \
|
|
|
|
# && npm config set depth 0 \
|
|
|
|
# && npm i install
|
2022-06-11 00:22:47 +00:00
|
|
|
RUN npm ci
|
|
|
|
|
2022-06-13 17:28:56 +00:00
|
|
|
# Get all the code needed to run the app
|
|
|
|
COPY . /usr/src/app
|
2022-06-11 00:22:47 +00:00
|
|
|
|
2022-06-11 01:26:09 +00:00
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
FROM nginx:1.13-alpine
|
2022-06-13 17:28:56 +00:00
|
|
|
COPY --from=build /usr/src/app/build /usr/share/nginx/html
|
|
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|
|
|
|
|