Update Dockerfile to include npm install step

This commit is contained in:
Dede Fuji Abdul 2024-02-28 15:29:13 +07:00
parent cf2db61c84
commit 8fa2f8cdd7

View File

@ -1,19 +1,13 @@
FROM node:lts-alpine as build-stage FROM node:lts-alpine as build-stage
WORKDIR /app WORKDIR /app
# COPY package*.json ./ COPY package*.json ./
# RUN npm install RUN npm install
COPY . . COPY . .
RUN npm run build RUN npm run build
# FROM nginx:stable-alpine as production-stage FROM nginx:stable-alpine as production-stage
# COPY --from=build-stage /app/dist /usr/share/nginx/html COPY --from=build-stage /app/dist /usr/share/nginx/html
# COPY --from=build-stage /app/nginx.conf /etc/nginx/nginx.conf COPY --from=build-stage /app/nginx.conf /etc/nginx/nginx.conf
# EXPOSE 32166
# CMD ["nginx", "-g", "daemon off;"]
FROM nginx:stable-alpine
COPY /dist /usr/share/nginx/html
COPY /nginx.conf /etc/nginx/nginx.conf
EXPOSE 32166 EXPOSE 32166
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]
@ -22,3 +16,9 @@ CMD ["nginx", "-g", "daemon off;"]
# COPY /nginx.conf /etc/nginx/nginx.conf # COPY /nginx.conf /etc/nginx/nginx.conf
# EXPOSE 32166 # EXPOSE 32166
# CMD ["nginx", "-g", "daemon off;"] # CMD ["nginx", "-g", "daemon off;"]
# FROM nginx:stable-alpine
# COPY /dist /usr/share/nginx/html
# COPY /nginx.conf /etc/nginx/nginx.conf
# EXPOSE 32166
# CMD ["nginx", "-g", "daemon off;"]