fix: batch 4 — connection pooling, graceful shutdown, email verification UX
- Prisma: connection_limit=10, pool_timeout=30 on DATABASE_URL in both compose files - Graceful shutdown: SIGTERM/SIGINT forwarded to Node process in docker-entrypoint.sh - testEmailConnection: replaced real email send with transporter.verify(), simplified UI to single button - NotificationLog.userId index: confirmed already present, no change needed Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -68,7 +68,7 @@ services:
|
||||
env_file:
|
||||
- ../.env
|
||||
environment:
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-mopc}:${POSTGRES_PASSWORD:-devpassword}@postgres:5432/${POSTGRES_DB:-mopc}
|
||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-mopc}:${POSTGRES_PASSWORD:-devpassword}@postgres:5432/${POSTGRES_DB:-mopc}?connection_limit=10&pool_timeout=30
|
||||
- NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost:3000}
|
||||
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-dev-secret-key-for-local-development-only}
|
||||
- AUTH_SECRET=${AUTH_SECRET:-dev-secret-key-for-local-development-only}
|
||||
|
||||
@@ -23,7 +23,7 @@ services:
|
||||
- .env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- DATABASE_URL=postgresql://mopc:${DB_PASSWORD}@postgres:5432/mopc
|
||||
- DATABASE_URL=postgresql://mopc:${DB_PASSWORD}@postgres:5432/mopc?connection_limit=10&pool_timeout=30
|
||||
- NEXTAUTH_URL=${NEXTAUTH_URL}
|
||||
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
|
||||
- AUTH_SECRET=${NEXTAUTH_SECRET}
|
||||
|
||||
@@ -59,4 +59,18 @@ else
|
||||
fi
|
||||
|
||||
echo "==> Starting application..."
|
||||
exec node server.js
|
||||
|
||||
# Graceful shutdown: forward SIGTERM/SIGINT to the Node process
|
||||
# so in-flight requests can complete before the container exits.
|
||||
shutdown() {
|
||||
echo "==> Received shutdown signal, stopping gracefully..."
|
||||
kill -TERM "$NODE_PID" 2>/dev/null
|
||||
wait "$NODE_PID"
|
||||
exit $?
|
||||
}
|
||||
|
||||
trap shutdown TERM INT
|
||||
|
||||
node server.js &
|
||||
NODE_PID=$!
|
||||
wait "$NODE_PID"
|
||||
|
||||
Reference in New Issue
Block a user