Files
evilspins/Dockerfile
valere 14fc999661
All checks were successful
Deploy App / build (push) Successful in 1m15s
Deploy App / deploy (push) Successful in 44s
try fix pnpm symlink error on deploy 3
2025-11-07 19:55:27 +01:00

42 lines
1.1 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ==========================================================
# Stage 1 — Builder
# ==========================================================
FROM node:20-bookworm AS builder
# On force une locale et on active un cache PNPM local
ENV LANG=C.UTF-8
ENV PNPM_HOME=/usr/local/share/pnpm
ENV PATH=$PNPM_HOME:$PATH
WORKDIR /app
# Copie des fichiers nécessaires à linstallation
COPY package.json pnpm-lock.yaml ./
# Installation propre et isolée
RUN npm install -g pnpm && pnpm install --frozen-lockfile
# Copie du reste du projet (sans node_modules ni .output)
COPY . .
# Build Nuxt ou autre app JS
RUN pnpm build
# ==========================================================
# Stage 2 — Runner (production)
# ==========================================================
FROM node:20-slim AS runner
ENV NODE_ENV=production
WORKDIR /app
# On ne garde que loutput final (pas de node_modules PNPM dans la prod)
COPY --from=builder /app/.output ./.output
COPY --from=builder /app/package.json ./
EXPOSE 3000
# Commande de démarrage (Nuxt 3 par défaut)
CMD ["node", ".output/server/index.mjs"]