Skip to content

Commit de889b1

Browse files
committed
fix: improve database seeding error handling in docker-entrypoint.sh
- Added error handling for the database seeding process to exit the container if seeding fails, enhancing reliability during startup.
1 parent 9e4741d commit de889b1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docker-entrypoint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ echo "Migrating database..."
66
npm run migrate:deploy
77

88
echo "Seeding database..."
9-
npm run migrate:seed
9+
if ! npm run migrate:seed; then
10+
echo "Database seeding failed! Exiting container..."
11+
exit 1
12+
fi
1013

1114
echo "Starting pm2..."
1215
pm2-runtime start ecosystem.config.js --env production

0 commit comments

Comments
 (0)