fix: disable husky only on production

This commit is contained in:
Krzysztof Durek
2024-07-16 14:11:44 +02:00
parent 2d64815c12
commit e249e878f6

View File

@@ -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