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:
2026-08-05 21:35:22 +03:30
co-authored by Cursor
parent 67cfc17079
commit cbcea58e94
199 changed files with 10895 additions and 4 deletions
+25
View File
@@ -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"