Files
football-next/QUICK_DEPLOY_GUIDE.md

139 lines
3.2 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# راهنمای سریع دیپلوی
## سایت‌های مورد نیاز:
### ✅ حتماً باید باز باشند:
1. **registry.npmjs.org** - برای دانلود پکیج‌های Node.js
2. **binaries.prisma.sh** - برای دانلود Prisma engines (مشکل اصلی!)
3. **registry.hub.docker.com** - برای دانلود Docker base images
## راه‌حل‌های سریع:
### 🎯 راه‌حل ۱: تنظیم Shecan DNS (۵ دقیقه)
روی سرور:
```bash
# ویرایش DNS
sudo nano /etc/resolv.conf
# اضافه کردن این خطوط
nameserver 178.22.122.100
nameserver 185.51.200.2
# ذخیره و خروج (Ctrl+X, Y, Enter)
# تست
ping binaries.prisma.sh
```
بعد دوباره deploy کنید در Coolify.
---
### 🎯 راه‌حل ۲: Build روی سرور خارج (۱۵ دقیقه)
**مرحله ۱: روی سرور/VPS خارج یا لپ‌تاپ با VPN**
```bash
# Clone
git clone https://mugit.ir/alisaeed/football-next.git
cd football-next
# Build
docker build -t football-next:latest \
--build-arg DATABASE_URL="postgresql://user:pass@host:5432/db" \
--build-arg NEXTAUTH_URL="https://yourdomain.com" \
--build-arg NEXTAUTH_SECRET="your-secret-key" \
.
# Save
docker save football-next:latest | gzip > football-next.tar.gz
```
**مرحله ۲: انتقال به سرور ایران**
```bash
# با SCP
scp football-next.tar.gz user@iran-server:/tmp/
# یا آپلود به فایل‌منیجر Coolify
```
**مرحله ۳: Load در سرور**
```bash
# SSH به سرور
ssh user@iran-server
# Load image
cd /tmp
gunzip -c football-next.tar.gz | docker load
# بررسی
docker images | grep football-next
```
**مرحله ۴: تنظیم Coolify**
1. در Coolify به جای "Git Repository"، از "Docker Image" استفاده کنید
2. نام image را وارد کنید: `football-next:latest`
3. Environment variables را تنظیم کنید
4. Deploy کنید
---
### 🎯 راه‌حل ۳: Push به Docker Hub (۲۰ دقیقه)
**روی سیستم با اینترنت:**
```bash
# Login
docker login
# Build
docker build -t your-username/football-next:latest .
# Push
docker push your-username/football-next:latest
```
**در Coolify:**
- Source: Docker Image
- Image: `your-username/football-next:latest`
---
## تست دسترسی:
```bash
# روی سرور
curl -I https://binaries.prisma.sh
curl -I https://registry.npmjs.org
```
اگر خطا داد → از راه‌حل ۱ یا ۲ استفاده کنید.
---
## متغیرهای محیطی مورد نیاز:
```env
DATABASE_URL=postgresql://user:password@host:5432/dbname
NEXTAUTH_URL=https://your-domain.com
NEXTAUTH_SECRET=your-secret-key-minimum-32-characters
IPPANEL_TOKEN=your-token (optional)
```
---
## توصیه نهایی:
**سریع‌ترین راه:** راه‌حل ۲ (Build روی سرور خارج)
- یک بار ۲۰۰-۳۰۰ مگابایت حجم
- بدون نیاز به تغییر DNS یا تنظیمات سرور
- ۱۰۰٪ کار می‌کنه
**راحت‌ترین راه:** راه‌حل ۱ (Shecan DNS)
- اگر کار کرد، دیگه مشکلی نداری
- برای deployهای بعدی هم کار می‌کنه