From acff8c855ed01e1006e485b5d46831a825f083fe Mon Sep 17 00:00:00 2001 From: dongkyun-dev Date: Sat, 16 Dec 2023 12:27:53 +0900 Subject: [PATCH] feat: test --- Dockerfile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b59f849..ac976f0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,19 @@ -FROM node:20-slim as BUILD +FROM node:20-slim AS base ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" +RUN corepack enable +COPY . /app WORKDIR /app -COPY . . +FROM base AS prod-deps +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile -RUN corepack enable -RUN corepack prepare pnpm@latest --activate -RUN pnpm install +FROM base AS build +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile RUN pnpm run build -FROM node:20.10.0-alpine - +FROM base +COPY --from=prod-deps /app/node_modules /app/node_modules +COPY --from=build /app/dist /app/dist EXPOSE 3000 - -WORKDIR /app - -COPY --from=BUILD /app/ . - -ENTRYPOINT ["pnpm", "run", "start"] +CMD [ "pnpm", "start" ]