echos-ocr/start.sh
Randall Stillwell 3b8d580ded Add database auto-migration, storage cleanup, and startup fixes
- Add start.sh that runs prisma db push before starting the server,
  creating tables automatically on first deploy
- Copy prisma CLI + engines into production image for runtime migrations
- Add configurable storage cleanup: source PDF retention (default 30d)
  and image retention (default 180d) with manual trigger in Settings
- Add /api/cleanup endpoint (GET for status, POST to run)
- Add retention settings to AppSettings schema
- Add ListObjectsV2 helper to minio.ts for bulk cleanup

Tested: local Docker build passes
Made-with: Cursor
2026-03-10 13:21:05 -05:00

8 lines
210 B
Bash
Executable file

#!/bin/sh
set -e
echo "Running database migrations..."
npx prisma db push --skip-generate 2>&1 || echo "Warning: prisma db push failed, tables may already exist"
echo "Starting server..."
exec node server.js