Compare commits

..

No commits in common. "1c3afac679047e717b3c73d6407af4821987d3c6" and "5b3f432c3af057d814e63ed452308477c55565ff" have entirely different histories.

View File

@ -15,19 +15,34 @@ RUN --mount=type=ssh \
ssh-keyscan git.4nkweb.com >> /root/.ssh/known_hosts && \
npm install --frozen-lockfile
# Configuration pour le développement
FROM node:19-alpine AS development
# Rebuild the source code only when needed
FROM node:19-alpine AS builder
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 . .
COPY tsconfig.json tsconfig.json
COPY next.config.js next.config.js
COPY src src
# Création de l'utilisateur non-root
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 lutilisateur 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", "dev"]
CMD ["npm", "run", "start"]
EXPOSE 3000