From de1de1d3bc61e7d58647cc7fcd7c8b71cee69972 Mon Sep 17 00:00:00 2001 From: Daniel Arroyo Date: Tue, 24 Mar 2026 23:04:26 -0300 Subject: [PATCH] fix: Run prisma db push but continue if OOM and DB exists --- docker-entrypoint.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 7223c2d..d5b8500 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -9,13 +9,17 @@ echo "Checking database..." mkdir -p /app/data chmod 777 /app/data -# Only run db push if database file doesn't exist -if [ ! -f /app/data/dev.db ]; then - echo "Database not found, creating..." - ./node_modules/prisma/build/index.js db push --skip-generate -else - echo "Database already exists, skipping db push..." -fi +# Run db push (creates/updates database schema) +# If it fails due to OOM but DB exists, continue anyway +./node_modules/prisma/build/index.js db push --skip-generate || { + exit_code=$? + if [ -f /app/data/dev.db ]; then + echo "db push failed (code $exit_code) but database exists, continuing..." + else + echo "db push failed and database does not exist" + exit $exit_code + fi +} echo "Starting application..." exec "$@"