perf(docker): optimize pnpm installation

This commit is contained in:
Théo LUDWIG 2024-08-25 01:39:16 +02:00
parent f0b22f6a06
commit bf1729cf0d
Signed by: theoludwig
GPG Key ID: ADFE5A563D718F3B
3 changed files with 7 additions and 2 deletions

View File

@ -2,11 +2,13 @@ FROM node:22.4.1-slim AS node-pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
ENV TURBO_TELEMETRY_DISABLED=1
ENV DO_NOT_TRACK=1
WORKDIR /usr/src/app
FROM node-pnpm AS builder
RUN pnpm install --global turbo@2.0.14
COPY ./ ./
RUN pnpm install --global turbo@2.0.14
RUN turbo prune @repo/api --docker
FROM node-pnpm AS installer

View File

@ -1,3 +1,4 @@
TZ=UTC
HOSTNAME=0.0.0.0
PORT=5000
NEXT_TELEMETRY_DISABLED=1

View File

@ -2,11 +2,13 @@ FROM node:22.4.1-slim AS node-pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
ENV TURBO_TELEMETRY_DISABLED=1
ENV DO_NOT_TRACK=1
WORKDIR /usr/src/app
FROM node-pnpm AS builder
RUN pnpm install --global turbo@2.0.14
COPY ./ ./
RUN pnpm install --global turbo@2.0.14
RUN turbo prune @repo/website --docker
FROM node-pnpm AS installer