Deploy via committed dist: local Nest build, server runs with .env
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>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user