From 0a0ed891b9d201a89b2664c3f8efd094a6d8a9f7 Mon Sep 17 00:00:00 2001 From: "A.Yamamoto" Date: Mon, 13 May 2024 12:15:38 +0900 Subject: [PATCH] =?UTF-8?q?devDependencies=E3=81=8C=E5=85=A5=E3=82=8A?= =?UTF-8?q?=E8=BE=BC=E3=81=BE=E3=81=AA=E3=81=84=E6=A7=98=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infra/docker/Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/infra/docker/Dockerfile b/infra/docker/Dockerfile index a3feda49..9c1508da 100644 --- a/infra/docker/Dockerfile +++ b/infra/docker/Dockerfile @@ -10,8 +10,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ && apt-get install -yqq --no-install-recommends \ python3 -RUN corepack enable - WORKDIR /jetdisc COPY --link ["pnpm-lock.yaml", "package.json", "./"] @@ -24,6 +22,14 @@ COPY --link . ./ ARG NODE_ENV=production RUN pnpm build +# ビルド成果物だけど取り扱うレイヤ +FROM node:${NODE_VERSION} AS node-lib + +WORKDIR /jetdisc + +COPY --link ["pnpm-lock.yaml", "package.json", "./"] +RUN pnpm i --frozen-lockfile --prod + FROM node:${NODE_VERSION}-slim AS runner ARG UID="991" @@ -43,7 +49,7 @@ RUN apt-get update \ USER jetdisc WORKDIR /jetdisc -COPY --chown=jetdisc:jetdisc --from=builder /jetdisc/node_modules ./node_modules +COPY --chown=jetdisc:node-lib --from=builder /jetdisc/node_modules ./node_modules COPY --chown=jetdisc:jetdisc --from=builder /jetdisc/built ./built COPY --chown=jetdisc:jetdisc . ./