Skip to content

Commit

Permalink
CD: add multi-stage build and yarn-lock based build
Browse files Browse the repository at this point in the history
  • Loading branch information
jinho-choi123 committed Apr 26, 2024
1 parent 97faee3 commit 0f12908
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
# Dockerfile for production build
FROM node:18-alpine
FROM node:18-alpine AS builder

WORKDIR /app

COPY . .

RUN yarn
RUN yarn --frozen-lockfile

RUN yarn build

FROM node:18-alpine

WORKDIR /app

COPY --from=builder /app/dist /app

RUN yarn global add serve

EXPOSE 80

ENTRYPOINT ["serve", "-l", "80", "/app/dist"]
ENTRYPOINT ["serve", "-l", "80", "/app"]

0 comments on commit 0f12908

Please sign in to comment.