chore: optimize dependency installation in Dockerfile using pnpm cache
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m55s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m55s
This commit is contained in:
@@ -9,8 +9,9 @@ RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
# Copie des fichiers de dépendances
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
# Installation des dépendances
|
||||
RUN pnpm install --frozen-lockfile
|
||||
# Installation des dépendances avec cache du store pnpm
|
||||
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
# Copie du code source
|
||||
COPY . .
|
||||
@@ -30,7 +31,8 @@ RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
|
||||
# Copie des dépendances de production
|
||||
COPY --from=builder /app/package.json /app/pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile --prod
|
||||
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
|
||||
pnpm install --frozen-lockfile --prod
|
||||
|
||||
# Copie des fichiers nécessaires depuis le stage de build
|
||||
COPY --from=builder /app/.next ./.next
|
||||
|
||||
Reference in New Issue
Block a user