chore: optimize Docker build with multi-stage process and add standalone Next.js output (#75)

This commit is contained in:
LovelessCodes
2025-06-12 23:12:24 +02:00
committed by GitHub
parent f6114a56af
commit 1707557bea
3 changed files with 70 additions and 24 deletions

16
apps/web/entrypoint.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
# Run migrations from the Turborepo root context
echo "Running database migrations..."
# Navigate to the Turborepo root to run the db:migrate command
pnpm --prefix /app db:migrate
# Check if migration was successful
if [ $? -ne 0 ]; then
echo "\nDatabase migration failed! Exiting."
exit 1
fi
echo "\nStarting Next.js application..."
# Start the Next.js application from the web app's directory
exec node .next/standalone/apps/web/server.js