Skip to content

Commit

Permalink
Fix docker no build stage code
Browse files Browse the repository at this point in the history
  • Loading branch information
hsjsjsj009 committed Mar 26, 2021
1 parent e78c621 commit 0759395
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions yarn-Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions yarn-no-build-stage-Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# build stage
FROM node:lts-alpine as build-env
FROM node:lts-alpine
ENV NODE_ENV=production

ADD . /opt/app
Expand Down

0 comments on commit 0759395

Please sign in to comment.