mirror of
https://github.com/andrey271192/Domain_web.git
synced 2026-09-20 14:41:58 +00:00
fix(deploy): run next start from repo root on VPS
Standalone traced node_modules were incomplete after partial sync; use npm start with production deps at INSTALL_DIR for reliable boots. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -109,11 +109,10 @@ build_app() {
|
||||
npx prisma generate
|
||||
npx prisma db push
|
||||
npm run build
|
||||
rm -rf node_modules
|
||||
# Keep production deps at repo root; `next start` is more reliable than
|
||||
# standalone on small VPS (avoids incomplete traced node_modules).
|
||||
npm ci --omit=dev
|
||||
npx prisma generate
|
||||
cp -r .next/static .next/standalone/.next/static
|
||||
cp -r public .next/standalone/public
|
||||
journalctl --vacuum-size=80M 2>/dev/null || true
|
||||
apt-get clean 2>/dev/null || true
|
||||
}
|
||||
@@ -128,12 +127,12 @@ Wants=docker.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=${INSTALL_DIR}/.next/standalone
|
||||
WorkingDirectory=${INSTALL_DIR}
|
||||
EnvironmentFile=${INSTALL_DIR}/.env
|
||||
Environment=HOSTNAME=0.0.0.0
|
||||
Environment=PORT=${APP_PORT}
|
||||
Environment=NODE_ENV=production
|
||||
ExecStart=/usr/bin/node server.js
|
||||
ExecStart=/usr/bin/npm run start --silent
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
|
||||
10
uninstall.sh
10
uninstall.sh
@@ -2,7 +2,7 @@
|
||||
# Domain Scanner — one-command uninstall
|
||||
set -euo pipefail
|
||||
|
||||
INSTALL_DIR="${DOMAIN_SCANNER_INSTALL_DIR:-/opt/domain_web}"
|
||||
INSTALL_DIR="${DOMAIN_SCANNER_INSTALL_DIR:-/opt/domain-scanner}"
|
||||
SERVICE_NAME="domain-scanner"
|
||||
NGINX_SITE="domain-scanner"
|
||||
LEGACY_SERVICE="geoexport-site"
|
||||
@@ -27,6 +27,13 @@ stop_docker() {
|
||||
fi
|
||||
}
|
||||
|
||||
stop_app() {
|
||||
systemctl stop "${SERVICE_NAME}.service" 2>/dev/null || true
|
||||
systemctl disable "${SERVICE_NAME}.service" 2>/dev/null || true
|
||||
rm -f "/etc/systemd/system/${SERVICE_NAME}.service"
|
||||
systemctl daemon-reload
|
||||
}
|
||||
|
||||
stop_legacy() {
|
||||
systemctl stop "${LEGACY_SERVICE}.service" 2>/dev/null || true
|
||||
systemctl disable "${LEGACY_SERVICE}.service" 2>/dev/null || true
|
||||
@@ -51,6 +58,7 @@ remove_files() {
|
||||
}
|
||||
|
||||
need_root
|
||||
stop_app
|
||||
stop_docker
|
||||
stop_legacy
|
||||
remove_nginx
|
||||
|
||||
Reference in New Issue
Block a user