Improved installer
This commit is contained in:
+10
-7
@@ -59,6 +59,9 @@ npm run build
|
|||||||
|
|
||||||
# Create systemd service
|
# Create systemd service
|
||||||
SERVICE_FILE="/etc/systemd/system/dockship.service"
|
SERVICE_FILE="/etc/systemd/system/dockship.service"
|
||||||
|
INSTALL_DIR=$(pwd)
|
||||||
|
NODE_PATH=$(which node)
|
||||||
|
USER_NAME=$(whoami)
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Creating systemd service at $SERVICE_FILE..."
|
echo "Creating systemd service at $SERVICE_FILE..."
|
||||||
@@ -69,15 +72,15 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=$(pwd)
|
WorkingDirectory=$INSTALL_DIR
|
||||||
# Use Node directly to run Next.js standalone server
|
# Run Next.js normally (non-standalone)
|
||||||
ExecStart=$(which node) .next/standalone/server.js
|
ExecStart=$(which npm) run start
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
EnvironmentFile=$(pwd)/.env
|
EnvironmentFile=$INSTALL_DIR/.env
|
||||||
Environment=PATH=$(dirname $(which node)):/usr/bin:/bin
|
Environment=PATH=$(dirname $NODE_PATH):/usr/bin:/bin
|
||||||
User=$(whoami)
|
User=$USER_NAME
|
||||||
Group=$(whoami)
|
Group=$USER_NAME
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
Reference in New Issue
Block a user