From e249e878f6c8bcfca7c368de4af8847e7ad1b81b Mon Sep 17 00:00:00 2001 From: Krzysztof Durek <21038648+kdurek@users.noreply.github.com> Date: Tue, 16 Jul 2024 14:11:44 +0200 Subject: [PATCH] fix: disable husky only on production --- Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 11b66bde..2b2a1ca8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,6 @@ # Etapa 1: Prepare image for building FROM node:18-slim AS base -# Disable husky -ENV HUSKY=0 - # Install dependencies ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" @@ -11,6 +8,10 @@ RUN corepack enable && apt-get update && apt-get install -y python3 make g++ git WORKDIR /app +# Disable husky +ENV HUSKY=0 +COPY .husky/install.mjs ./.husky/install.mjs + # Copy package.json and pnpm-lock.yaml COPY package.json pnpm-lock.yaml ./ @@ -36,6 +37,12 @@ RUN corepack enable && apt-get update && apt-get install -y curl && apt-get inst WORKDIR /app +ENV NODE_ENV production + +# Disable husky +ENV HUSKY=0 +COPY --from=base /app/.husky/install.mjs ./.husky/install.mjs + # Copy the rest of the source code COPY --from=base /app/.next ./.next COPY --from=base /app/dist ./dist