From 63fc45927f0bbacf3e24be65e4f1a85a45685ae4 Mon Sep 17 00:00:00 2001 From: omaroughriss Date: Fri, 4 Jul 2025 12:09:28 +0200 Subject: [PATCH] Update Dockerfile to use dev mode --- Dockerfile | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index c5d5b48e..589a009e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,34 +15,19 @@ RUN --mount=type=ssh \ ssh-keyscan git.4nkweb.com >> /root/.ssh/known_hosts && \ npm install --frozen-lockfile -# Rebuild the source code only when needed -FROM node:19-alpine AS builder +# Configuration pour le développement +FROM node:19-alpine AS development WORKDIR /leCoffre-front COPY --from=deps /leCoffre-front/node_modules ./node_modules COPY --from=deps /leCoffre-front/package.json ./package.json COPY --from=deps /leCoffre-front/.env ./.env -COPY tsconfig.json tsconfig.json -COPY next.config.js next.config.js -COPY src src +COPY . . -RUN npm run build - -# Production image, copy all the files and run next -FROM node:19-alpine AS production -WORKDIR /leCoffre-front - -# Création de l’utilisateur non-root +# Création de l'utilisateur non-root RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser . -COPY public ./public -COPY --from=builder --chown=lecoffreuser /leCoffre-front/node_modules ./node_modules -COPY --from=builder --chown=lecoffreuser /leCoffre-front/.next ./.next -COPY --from=builder --chown=lecoffreuser /leCoffre-front/next.config.js ./next.config.js -COPY --from=builder --chown=lecoffreuser /leCoffre-front/package.json ./package.json -COPY --from=builder --chown=lecoffreuser /leCoffre-front/.env ./.env - USER lecoffreuser -CMD ["npm", "run", "start"] +CMD ["npm", "run", "dev"] EXPOSE 3000 \ No newline at end of file