From 41d3abe12425d05e848dbd4bbadb402b13f2b1d8 Mon Sep 17 00:00:00 2001 From: mxmlndml <42516330+MXMLNDML@users.noreply.github.com> Date: Sun, 28 May 2023 15:36:05 +0200 Subject: [PATCH] add dockerfile --- Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6ae20e2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM node:alpine AS base + +RUN corepack enable +RUN corepack prepare pnpm@latest --activate + + +FROM base as dependencies + +WORKDIR /app +COPY package.json pnpm-lock.yaml ./ +RUN pnpm install + + +FROM base as build + +WORKDIR /app +COPY . . +COPY --from=dependencies /app/node_modules ./node_modules +RUN pnpm build +RUN pnpm prune --prod + + +FROM base as deploy + +WORKDIR /app +COPY --from=build /app/dist ./dist +COPY --from=build /app/node_modules ./node_modules + + +CMD ["node", "."] \ No newline at end of file