Files
worst_web/scripts/setup.sh
T
renato97 4e9f815a53 fix: standalone start script copies static files automatically
- scripts/start.js: copies .next/static to .next/standalone/.next/static
  before launching the standalone server (prevents CSS 404)
- package.json: start script now uses scripts/start.js
- Dockerfile: removed fragile manual better-sqlite3 copy
  (already included in standalone output)
- scripts/setup.sh: added local prod option for npm start
2026-07-23 16:25:52 -03:00

44 lines
957 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
echo "=== worst-scan-web setup ==="
echo ""
if [ ! -f .env ]; then
cp .env.example .env
echo "[INFO] .env created from .env.example — edit it with your API settings."
else
echo "[OK] .env already exists"
fi
echo ""
echo "Choose install method:"
echo " 1) Local dev (npm run dev)"
echo " 2) Local prod (npm run build && npm start)"
echo " 3) Docker Compose (producción)"
echo ""
read -rp "Method [1/2/3]: " method
if [ "$method" = "3" ]; then
echo ""
echo "=== Docker build & start ==="
docker compose up -d --build
echo ""
echo "Web running at http://localhost:3000"
elif [ "$method" = "2" ]; then
echo ""
echo "=== Local prod build ==="
npm install
npm run build
echo ""
echo "Run: npm start"
echo "Web running at http://localhost:3000"
else
echo ""
echo "=== Local dev ==="
npm install
echo ""
echo "Run: npm run dev"
echo "Web running at http://localhost:3000"
fi