diff --git a/package.json b/package.json index edaf965..0c90428 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "next dev --port 3445", "build": "next build", - "start": "npm install && npm run build && next start", + "start": "next start", "export": "next build && npx serve out" }, "dependencies": { diff --git a/start-pm2.sh b/start-pm2.sh new file mode 100644 index 0000000..684553f --- /dev/null +++ b/start-pm2.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# IPFS-Portal PM2 start script — runs from /srv/apps/ipfs-portal +# Usage: pm2 start start-pm2.sh --name ipfs-portal +set -e +cd /srv/apps/ipfs-portal || { echo "ERROR: /srv/apps/ipfs-portal not found"; exit 1; } +echo "=== npm install ===" +npm install +echo "=== npm run build ===" +npm run build +echo "=== next start port ${PORT:=3005} ===" +exec npx next start --port "$PORT"