-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CD: add multi-stage build and yarn-lock based build
- Loading branch information
1 parent
97faee3
commit 0f12908
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |