From 0759395a43c09db62dd9c3832d51beb5dce99e08 Mon Sep 17 00:00:00 2001 From: Dipta Laksmana Date: Fri, 26 Mar 2021 14:13:32 +0700 Subject: [PATCH] Fix docker no build stage code --- yarn-Dockerfile | 5 +++-- yarn-no-build-stage-Dockerfile | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn-Dockerfile b/yarn-Dockerfile index 2f51083..0fcc8fe 100644 --- a/yarn-Dockerfile +++ b/yarn-Dockerfile @@ -1,5 +1,5 @@ -# build stage -FROM node:lts-alpine as build-env +# build stage called build-env +FROM node:lts-alpine as build-env ENV NODE_ENV=production ADD . /opt/app @@ -11,6 +11,7 @@ RUN \ FROM node:lts-alpine WORKDIR /opt/app +# --from is used to tell the docker to get data from build stage called build-env COPY --from=build-env /opt/app/build /opt/app/build RUN npm install -g serve diff --git a/yarn-no-build-stage-Dockerfile b/yarn-no-build-stage-Dockerfile index 695c3d8..2d368c8 100644 --- a/yarn-no-build-stage-Dockerfile +++ b/yarn-no-build-stage-Dockerfile @@ -1,5 +1,4 @@ -# build stage -FROM node:lts-alpine as build-env +FROM node:lts-alpine ENV NODE_ENV=production ADD . /opt/app