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