fix(deploy): exécuter sur le serveur + build CI réutilisé (~2 min)
Some checks failed
CI / Lint, Test & Build (push) Failing after 7m52s
CI / Deploy production (on server) (push) Has been cancelled

Le deploy SSH depuis ubuntu-24.04 ne rebuildait pas sur 190 (image d'hier).
Déploiement sur runner docker-host, artifact Next.js de la CI, Dockerfile.prebuilt,
script deploy-prod.sh. workflow_run supprimé au profit de needs:[ci] même fichier.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Antigravity
2026-05-17 10:19:16 +00:00
parent 0e60c0e591
commit 759487cb36
5 changed files with 291 additions and 197 deletions

View File

@@ -0,0 +1,36 @@
# Image rapide : le build Next.js est déjà fait en CI (artifact).
FROM node:22-bookworm-slim AS runner
ARG GIT_COMMIT=unknown
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV GIT_COMMIT=$GIT_COMMIT
RUN apt-get update && apt-get install -y --no-install-recommends \
openssl \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd --system --gid 1001 nodejs \
&& useradd --system --uid 1001 --gid nodejs nextjs
COPY public ./public
RUN mkdir -p ./data/uploads/notes ./data/backups && chown -R nextjs:nodejs ./data
COPY .next/standalone ./
COPY .next/static ./.next/static
COPY prisma ./prisma
COPY node_modules/.prisma ./node_modules/.prisma
COPY node_modules/@prisma ./node_modules/@prisma
COPY node_modules/prisma ./node_modules/prisma
COPY docker-entrypoint.sh ./docker-entrypoint.sh
RUN chmod +x ./docker-entrypoint.sh
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
ENTRYPOINT ["./docker-entrypoint.sh"]