-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·61 lines (50 loc) · 1.87 KB
/
start.sh
File metadata and controls
executable file
·61 lines (50 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
# BizManager – Railway.app Deployment Script
# This script is executed by Railway's Nixpacks build system
set -e
echo "============================================================"
echo " BizManager – Railway Deployment"
echo "============================================================"
# Debug: Print PATH and available commands
echo "Current PATH: $PATH"
echo "Checking for Node.js and npm..."
# Try to find node and npm in common locations
if command -v node &> /dev/null; then
echo "✓ Node.js found: $(which node)"
echo " Node.js version: $(node --version)"
else
echo "✗ Node.js not found in PATH"
fi
if command -v npm &> /dev/null; then
echo "✓ npm found: $(which npm)"
echo " npm version: $(npm --version)"
else
echo "✗ npm not found in PATH"
echo "ERROR: npm not found. Node.js may not be installed."
echo "Please ensure nixpacks.toml is configured correctly."
exit 1
fi
echo "------------------------------------------------------------"
# Unset the deprecated npm production config to suppress
# "npm warn config production Use --omit=dev instead" warnings.
# Railway's environment may set npm_config_production=true; start.sh
# already passes --omit=dev explicitly where needed.
unset npm_config_production
# Navigate to backend directory
cd backend
# Install dependencies (dev deps excluded via --omit=dev)
echo "[1/3] Installing backend dependencies..."
npm ci --omit=dev --prefer-offline || npm install --omit=dev
# Initialize .env file if it doesn't exist
if [ ! -f .env ]; then
echo "[2/3] Initializing .env file..."
npm run init
fi
# Set up database
echo "[3/3] Setting up database..."
npm run setup
# Start the backend server
echo "============================================================"
echo " Starting BizManager API server..."
echo "============================================================"
npm start