Answer the question
In order to leave comments, you need to log in
How does a 2-image Dockerfile work?
Hello everyone,
I have this Dockerfile:
FROM node:13 as node
WORKDIR /app
COPY package.json /app/
COPY package-lock.json /app/
COPY docker-additions/.npmrc /app/
RUN npm install
COPY ./ /app/
RUN npm run config
RUN npm run build
FROM nginx:1.18.0-alpine
COPY --from=node /app/dist/ /usr/share/nginx/html
COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf
Answer the question
In order to leave comments, you need to log in
FROM node:13 as node WORKDIR /app COPY package.json /app/ COPY package-lock.json /app/ COPY docker-additions/.npmrc /app/ RUN npm install COPY ./ /app/ RUN npm run config RUN npm run build
FROM nginx:1.18.0-alpine COPY --from=node /app/dist/ /usr/share/nginx/html COPY ./nginx-custom.conf /etc/nginx/conf.d/default.conf
COPY --from=node /app/dist/ /usr/share/nginx/html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question