1 file changed
+8
crates/cli/src/deploy/process_deploy_nextjs_ssr.rs
+8
@@ -346,6 +346,14 @@ pub async fn process_deploy_nextjs_ssr(env: Environment, config: Config) -> Resu
346
cd "$APP_PATH"
347
mkdir -p logs
348
349
+ # Backward compatibility: older operator-managed ecosystem.config.js files
350
+ # still point PM2 at `.next/standalone/server.js`. The current deploy flow
351
+ # rsyncs the *contents* of `.next/standalone/` into the app root, so the
352
+ # real entrypoint is `server.js`. Create a compatibility symlink so both
353
+ # layouts work and old PM2 configs do not crash after deploy.
354
+ mkdir -p .next/standalone
355
+ ln -sfn ../../server.js .next/standalone/server.js
356
+
357
echo "Starting $PM2_APP with pm2..."
358
if pm2 describe "$PM2_APP" > /dev/null 2>&1; then
359
pm2 delete "$PM2_APP"