feat: add Dockerfile (#124)

This commit is contained in:
云游君 authored and GitHub committed 2024-10-28 20:26:25 +08:00
1 parent a146ab16a2
commit ea0b4d2349
1 file changed
+22
+22
View File
@@ -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"]