Skip to content

Commit

Permalink
devDependenciesが入り込まない様に修正
Browse files Browse the repository at this point in the history
  • Loading branch information
na2na-p committed May 13, 2024
1 parent 812faea commit 0a0ed89
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions infra/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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", "./"]
Expand All @@ -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"
Expand All @@ -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 . ./

Expand Down

0 comments on commit 0a0ed89

Please sign in to comment.