Build on the developer machine without Docker, commit dist/, and run on the server with Dockerfile.dist plus compose env_file. Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
650 B
Bash
26 lines
650 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
MIRROR="${NPM_REGISTRY:-https://registry.npmmirror.com}"
|
|
|
|
echo "==> بیلد لوکال بدون Docker"
|
|
echo "==> registry: $MIRROR"
|
|
|
|
npm config set registry "$MIRROR"
|
|
npm ci --no-audit --no-fund
|
|
npx prisma generate
|
|
npm run build
|
|
|
|
if [ ! -f dist/main.js ]; then
|
|
echo "ERROR: dist/main.js ساخته نشد"
|
|
ls -la dist || true
|
|
exit 1
|
|
fi
|
|
|
|
echo "==> OK: dist/main.js آماده است"
|
|
echo "بعدی:"
|
|
echo " git add dist && git commit -m 'Build dist' && git push"
|
|
echo "روی سرور:"
|
|
echo " git pull && RUN_SEED=true docker compose -f docker-compose.dist.yml up -d --build"
|