All checks were successful
Build and Deploy / build (push) Successful in 1m34s
- Update build.yml to create .env.production from Gitea secrets - ANTHROPIC_API_KEY, CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN - Secure file with chmod 600 (owner read only) - Preserve env file across deployments - Update start.sh to source .env.production if it exists - Parse and export variables before starting server - Skip comments and empty lines 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
31 lines
756 B
Bash
31 lines
756 B
Bash
#!/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" |