feat(k8s): Sicherung und Hintergrund-Jobs lauffaehig machen

- Werkzeug-Image wabenhain-tools (Dockerfile "AS tools", Muster wie
  artista-modelcamp-tools): Im App-Image fehlten tsconfig.json und Pakete
  wie stripe, Bestandsabgleich und Bestellfreigabe brachen mit
  "Cannot find module" ab. Die CI baut es neben dem App-Image.
- Datenbank-Sicherung: PV auf der Storage Box (Customer/Wabenhain), der
  Unterordner db-backup entsteht per subPath. Vorher blieb der PVC ohne
  StorageClass haengen.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Nick SzaunigandClaude Opus 5.5 committed 2026-10-10 08:15:51 +02:00
1 parent b246c9ff4e
commit f28e5e9d84
3 files changed
+85 -12

No files matched your search

+20
View File
@@ -52,6 +52,26 @@ RUN pnpm add --save-prod \
@prisma/client@^7.9.1 @prisma/adapter-pg@^7.9.1 \
@prisma/adapter-mariadb@^7.9.1 mariadb@^3.5.3
# --- Werkzeuge (CronJobs) -------------------------------------------------
# Eigenes Image <repo>-tools fuer die Skripte unter scripts/, die als
# CronJob laufen (Bestandsabgleich mit ApiCore, Freigabe haengender
# Bestellungen), nach dem Muster von artista-modelcamp-tools. Das runner-
# Image enthaelt nur den Standalone-Output: dort fehlen tsconfig.json (der
# Pfad-Alias "@/") und Pakete wie stripe, die Skripte brechen dort mit
# "Cannot find module" ab. Steht VOR runner, damit ein Build ohne --target
# weiterhin das App-Image liefert.
FROM base AS tools
ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 --ingroup nodejs nextjs
COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
COPY --from=builder --chown=nextjs:nodejs /app/src ./src
COPY --from=builder --chown=nextjs:nodejs /app/scripts ./scripts
COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
COPY --from=builder --chown=nextjs:nodejs /app/prisma.config.ts /app/package.json /app/tsconfig.json ./
ENV PATH="/app/node_modules/.bin:${PATH}"
USER 1001
CMD ["tsx", "scripts/apicore-stock-sync.ts"]
# --- Runtime --------------------------------------------------------------
FROM base AS runner
ENV NODE_ENV=production