-
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.
chore: docker split builder and runner
- Loading branch information
1 parent
96026fc
commit 501320f
Showing
1 changed file
with
10 additions
and
6 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,15 +1,19 @@ | ||
FROM node:16-alpine | ||
FROM node:16-alpine as builder | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN npm install -g pnpm | ||
|
||
RUN pnpm install --frozen-lockfile | ||
|
||
RUN npm run build | ||
|
||
EXPOSE 3000 | ||
FROM node:16-alpine as runner | ||
|
||
WORKDIR /app | ||
ENV NODE_ENV production | ||
COPY . . | ||
RUN npm install -g pnpm | ||
RUN pnpm install --frozen-lockfile -P | ||
COPY --from=builder /app/dist ./dist | ||
|
||
EXPOSE 3000 | ||
CMD ["npm", "start"] |