Skip to content

Commit

Permalink
feat: add Dockerfile (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun authored Oct 28, 2024
1 parent a146ab1 commit ea0b4d2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:20-alpine as build-stage

WORKDIR /app
RUN corepack enable

COPY .npmrc package.json pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
pnpm install --frozen-lockfile

COPY . .
RUN pnpm build

# SSR
FROM node:20-alpine as production-stage

WORKDIR /app

COPY --from=build-stage /app/.output ./.output

EXPOSE 3000

CMD ["node", ".output/server/index.mjs"]

0 comments on commit ea0b4d2

Please sign in to comment.