#!/bin/sh # Immersive start script for Alpine Linux APP_DIR="/opt/immersive" LOG_DIR="/var/log/immersive" PID_FILE="/var/run/immersive.pid" cd "$APP_DIR" # Environment export NODE_ENV=production export NODE_OPTIONS="--max-old-space-size=2048" # Load secrets from environment file if it exists if [ -f "$APP_DIR/.env.production" ]; then # Export each line as an environment variable while IFS= read -r line || [ -n "$line" ]; do # Skip comments and empty lines case "$line" in \#*|"") continue ;; esac export "$line" done < "$APP_DIR/.env.production" fi # Optional: Set port (default 3001) # export PORT=3001 # Start the server exec node server.js >> "$LOG_DIR/app.log" 2>> "$LOG_DIR/error.log"