Skip to content

Commit

Permalink
refactor: restructure Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackDark committed Aug 1, 2024
1 parent f3cd99d commit 1247945
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ ENV PATH="$PNPM_HOME:$PATH"
RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/* \
&& corepack enable && corepack prepare pnpm@9 --activate
&& corepack enable \
&& corepack prepare pnpm@9 --activate
WORKDIR /app
COPY package.json pnpm-lock.yaml /app/

FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile

FROM base
RUN corepack use pnpm@9
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY index.ts /app/
COPY src/ /app/src/
COPY --from=prod-deps /app/node_modules /app/node_modules
RUN corepack use pnpm@9

ENV CONFIG_LOCATION=/app/config/config.yml
ENV SECRETS_LOCATION=/app/config/secrets.yml
Expand Down

0 comments on commit 1247945

Please sign in to comment.