Stabilize core: better-sqlite3, versioned migrations, graceful shutdown

- Replace experimental node:sqlite with better-sqlite3 (stable API)
- Replace try/catch migration pattern with schema_version tracking
- Add SIGTERM/SIGINT handler for clean shutdown (DB flush, scheduler stop)
- Fix BudgetPanel crash: remove undefined setShowAddCategory call
- Update Dockerfile: remove --experimental-sqlite, add native build tools
This commit is contained in:
Maurice
2026-03-22 17:52:24 +01:00
parent 3919c61eb6
commit d604ad1c5b
8 changed files with 472 additions and 55 deletions

View File

@@ -11,9 +11,11 @@ FROM node:22-alpine
WORKDIR /app
# Server-Dependencies installieren
# Server-Dependencies installieren (better-sqlite3 braucht Build-Tools)
COPY server/package*.json ./
RUN npm ci --production
RUN apk add --no-cache python3 make g++ && \
npm ci --production && \
apk del python3 make g++
# Server-Code kopieren
COPY server/ ./
@@ -33,4 +35,4 @@ ENV PORT=3000
EXPOSE 3000
CMD ["node", "--experimental-sqlite", "src/index.js"]
CMD ["node", "src/index.js"]