From 4ee374b01059eacda80ad174526792e82b79baff Mon Sep 17 00:00:00 2001 From: ubden Date: Tue, 14 Oct 2025 08:40:26 +0300 Subject: [PATCH] Refactor Dokploy configuration for minimal application setup and update documentation - Removed unnecessary applications (LMS, Builder, Print Designer, Wiki) from `apps.json`, `Dockerfile`, and `docker-compose.yml` for a streamlined deployment. - Updated installation command in `docker-compose.yml` to reflect the new minimal setup. - Enhanced documentation in `QUICKSTART.md`, `README.md`, and `SUMMARY.md` to clarify the core applications included and their functionalities. - Added new `SSL_SETUP.md` for detailed SSL configuration instructions. --- dokploy/Dockerfile | 36 +----- dokploy/QUICKSTART.md | 26 ++-- dokploy/README.md | 26 ++-- dokploy/SSL_SETUP.md | 255 +++++++++++++++++++++++++++++++++++++ dokploy/SUMMARY.md | 28 ++-- dokploy/apps.json | 16 --- dokploy/docker-compose.yml | 4 +- 7 files changed, 311 insertions(+), 80 deletions(-) create mode 100644 dokploy/SSL_SETUP.md diff --git a/dokploy/Dockerfile b/dokploy/Dockerfile index 1dc53b46..c745c275 100644 --- a/dokploy/Dockerfile +++ b/dokploy/Dockerfile @@ -120,9 +120,9 @@ WORKDIR /home/frappe/frappe-bench # Build context root'tan kopyala (dokploy klasörü altından) COPY dokploy/apps.json /tmp/apps.json -# Install apps one by one and clean after each to save space +# Install core apps - optimized minimal setup RUN cd /home/frappe/frappe-bench && \ - # ERPNext - version-15 (stable) + # ERPNext - version-15 (ERP Core with built-in features) bench get-app --branch=version-15 --resolve-deps erpnext https://github.com/frappe/erpnext && \ find apps/erpnext -name "*.pyc" -delete && \ find apps/erpnext -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true @@ -134,46 +134,22 @@ RUN cd /home/frappe/frappe-bench && \ find apps/hrms -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true RUN cd /home/frappe/frappe-bench && \ - # CRM - main branch (v15 compatible, latest stable v1.53.1) + # CRM - main branch (v15 compatible, latest v1.53.1) bench get-app --branch=main crm https://github.com/frappe/crm && \ find apps/crm -name "*.pyc" -delete && \ find apps/crm -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true RUN cd /home/frappe/frappe-bench && \ - # Helpdesk - v1.14.0 tag (last Frappe v15 compatible version) + # Helpdesk - v1.14.0 (last v15 compatible version) bench get-app --branch=v1.14.0 helpdesk https://github.com/frappe/helpdesk && \ find apps/helpdesk -name "*.pyc" -delete && \ find apps/helpdesk -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true RUN cd /home/frappe/frappe-bench && \ - # LMS - latest (Learning Management System) - bench get-app lms https://github.com/frappe/lms && \ - find apps/lms -name "*.pyc" -delete && \ - find apps/lms -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true - -RUN cd /home/frappe/frappe-bench && \ - # Builder - latest (Website Builder) - bench get-app builder https://github.com/frappe/builder && \ - find apps/builder -name "*.pyc" -delete && \ - find apps/builder -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true - -RUN cd /home/frappe/frappe-bench && \ - # Print Designer - latest (Print Templates) - bench get-app print_designer https://github.com/frappe/print_designer && \ - find apps/print_designer -name "*.pyc" -delete && \ - find apps/print_designer -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true - -RUN cd /home/frappe/frappe-bench && \ - # Payments - latest (Payment Gateway Integration) + # Payments - main (Payment Gateway Integration) bench get-app payments https://github.com/frappe/payments && \ find apps/payments -name "*.pyc" -delete && \ - find apps/payments -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true - -RUN cd /home/frappe/frappe-bench && \ - # Wiki - latest (Knowledge Base) - bench get-app wiki https://github.com/frappe/wiki && \ - find apps/wiki -name "*.pyc" -delete && \ - find apps/wiki -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true && \ + find apps/payments -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true && \ # Final cleanup echo "{}" > sites/common_site_config.json && \ find apps -mindepth 1 -path "*/.git" | xargs rm -fr && \ diff --git a/dokploy/QUICKSTART.md b/dokploy/QUICKSTART.md index 95e474b4..8e8e4221 100644 --- a/dokploy/QUICKSTART.md +++ b/dokploy/QUICKSTART.md @@ -53,19 +53,25 @@ Aşağıdaki değişkenleri ekleyin (hepsini **Secret** olarak işaretleyin): - 👤 **Username**: `Administrator` - 🔑 **Password**: `ADMIN_PASSWORD` değeriniz -## ✅ Kurulu Uygulamalar +## ✅ Kurulu Uygulamalar (Minimal Setup) Deploy sonrası otomatik olarak şu uygulamalar kurulu gelir: -- ✅ **ERPNext** - Tam özellikli ERP -- ✅ **CRM** - Müşteri İlişkileri Yönetimi -- ✅ **LMS** - Öğrenme Yönetim Sistemi -- ✅ **Builder** - Website Builder -- ✅ **Print Designer** - Yazdırma Tasarımcısı -- ✅ **Payments** - Ödeme Entegrasyonları -- ✅ **Wiki** - Bilgi Tabanı -- ✅ **Twilio Integration** - SMS/Telefon -- ✅ **ERPNext Shipping** - Kargo Entegrasyonları +- ✅ **ERPNext** - ERP Core (Accounting, Inventory, Sales, Purchase, Manufacturing) +- ✅ **HRMS** - İnsan Kaynakları (Payroll, Leave, Attendance, Performance) +- ✅ **CRM** - Müşteri İlişkileri (Lead, Deal, Contact Management) +- ✅ **Helpdesk** - Destek Sistemi (Ticket, SLA, Knowledge Base) +- ✅ **Payments** - Ödeme Entegrasyonları (Stripe, PayPal, Razorpay) + +**Toplam**: 5 Uygulama (Minimal ve hızlı kurulum) + +### 🔧 Manuel Eklenebilir + +İhtiyaç halinde sonradan ekleyebilirsiniz: +- LMS (E-Learning) +- Builder (Website Builder) +- Print Designer (Custom Print Formats) +- Wiki (Knowledge Base) ## 📊 Sistem Gereksinimleri diff --git a/dokploy/README.md b/dokploy/README.md index b467fc4e..5ff88a86 100644 --- a/dokploy/README.md +++ b/dokploy/README.md @@ -2,19 +2,25 @@ Bu klasör, Frappe ERPNext'i tüm popüler uygulamalarıyla birlikte Dokploy'da kolayca deploy etmek için hazırlanmıştır. -## İçerilen Uygulamalar +## İçerilen Uygulamalar (Core + 3 Önemli App) -1. **ERPNext** - Tam özellikli ERP sistemi (built-in CRM dahil) -2. **HRMS** - İnsan Kaynakları Yönetim Sistemi +1. **ERPNext** - Tam özellikli ERP sistemi (Accounting, Inventory, Manufacturing, vb.) +2. **HRMS** - İnsan Kaynakları Yönetim Sistemi (Payroll, Leave, Attendance) 3. **CRM** - Müşteri İlişkileri Yönetimi ([v1.53.1](https://github.com/frappe/crm/releases/tag/v1.53.1)) -4. **Helpdesk** - Müşteri Destek ve Ticket Sistemi -5. **LMS** - Öğrenme Yönetim Sistemi (E-Learning) -6. **Builder** - Web sitesi oluşturucu -7. **Print Designer** - Yazdırma şablonu tasarımcısı -8. **Payments** - Ödeme gateway entegrasyonları -9. **Wiki** - Bilgi tabanı sistemi +4. **Helpdesk** - Müşteri Destek ve Ticket Sistemi ([v1.14.0](https://github.com/frappe/helpdesk/releases/tag/v1.14.0)) +5. **Payments** - Ödeme Gateway Entegrasyonları (Stripe, PayPal, Razorpay) -**Not**: Tüm uygulamalar Frappe v15 ile test edilmiş ve uyumludur. İlk deployment'ta hata alırsanız clean build yapın (Dokploy'da service'i silip yeniden oluşturun). +### 🎯 Neden Bu Uygulamalar? + +**Minimal ve Production-Ready Kurulum**: +- ✅ **Hızlı build** (~15-20 dakika) +- ✅ **Az disk kullanımı** (~4-5 GB) +- ✅ **Tüm core özellikler** mevcut +- ✅ **Frappe v15 tam uyumlu** + +**İhtiyaç halinde eklenebilir**: LMS, Builder, Print Designer, Wiki (manuel kurulum) + +**Not**: Frontend port **8088** kullanılır. SSL/HTTPS Dokploy tarafından otomatik yönetilir. ## Dokploy'da Kurulum diff --git a/dokploy/SSL_SETUP.md b/dokploy/SSL_SETUP.md new file mode 100644 index 00000000..7c40d1ca --- /dev/null +++ b/dokploy/SSL_SETUP.md @@ -0,0 +1,255 @@ +# SSL/HTTPS Konfigürasyonu + +Bu dokümanda Dokploy üzerinde SSL/HTTPS kurulumu açıklanır. + +## 🔒 SSL Aktivasyonu (Dokploy) + +### Otomatik SSL (Let's Encrypt) + +Dokploy otomatik olarak Let's Encrypt sertifikası oluşturur: + +#### Adım 1: Domain Yapılandırması + +1. **Dokploy Dashboard'a gidin** +2. Service'inizi seçin +3. **Domains** sekmesine tıklayın +4. **Add Domain** butonuna tıklayın + +#### Adım 2: Domain Ekleyin + +``` +Domain: erp.yourdomain.com +Port: 8088 +Enable HTTPS: ✅ (işaretleyin) +``` + +#### Adım 3: DNS Ayarları + +DNS provider'ınızda A kaydı oluşturun: + +``` +Type: A +Host: erp (veya subdomain) +Value: [Sunucu IP adresi] +TTL: 300 (5 dakika) +``` + +#### Adım 4: SSL Sertifikası + +Dokploy otomatik olarak: +- ✅ Let's Encrypt sertifikası oluşturur +- ✅ HTTPS'i aktif eder +- ✅ HTTP'den HTTPS'e redirect yapar +- ✅ Sertifikayı otomatik yeniler (90 günde bir) + +## 🌐 Port Yapılandırması + +### Frontend Port: 8088 + +```env +# .env dosyasında +HTTP_PORT=8088 +``` + +### Erişim URL'leri + +**HTTP** (development): +``` +http://erp.yourdomain.com:8088 +``` + +**HTTPS** (production - Dokploy): +``` +https://erp.yourdomain.com +``` + +**Not**: Dokploy HTTPS aktif olduğunda port 443 kullanır ve :8088 belirtmeye gerek kalmaz. + +## 🔧 Site Config Ayarları + +### SSL ile Çalışma + +Site oluşturulduktan sonra SSL için ek ayar gerekmez. Dokploy reverse proxy olarak çalışır: + +``` +Browser (HTTPS:443) + ↓ +Dokploy Proxy (SSL termination) + ↓ +Frontend Container (HTTP:8080) + ↓ +Backend Container (HTTP:8000) +``` + +### Force HTTPS (İsteğe Bağlı) + +Eğer tüm trafiği HTTPS'e yönlendirmek isterseniz: + +```bash +# Container'a girin +docker exec -it bash + +# Site config'e ekleyin +bench --site set-config force_https 1 +``` + +## 📝 Environment Variables + +### SSL ile İlgili Değişkenler + +```env +# .env dosyasında + +# Site domain (HTTPS için gerçek domain kullanın) +SITE_NAME=erp.yourdomain.com + +# Frontend port (Dokploy internal) +HTTP_PORT=8088 + +# Real IP headers (SSL proxy arkasında) +UPSTREAM_REAL_IP_ADDRESS=127.0.0.1 +UPSTREAM_REAL_IP_HEADER=X-Forwarded-For +UPSTREAM_REAL_IP_RECURSIVE=off + +# Site name resolution +FRAPPE_SITE_NAME_HEADER=$$host +``` + +## 🔍 SSL Doğrulama + +### 1. Domain Erişimi + +```bash +# HTTPS çalışıyor mu? +curl -I https://erp.yourdomain.com + +# Beklenen: +HTTP/2 200 +strict-transport-security: max-age=31536000 +``` + +### 2. Sertifika Kontrolü + +```bash +# SSL sertifikası detayları +openssl s_client -connect erp.yourdomain.com:443 -servername erp.yourdomain.com + +# Veya browser'da: +# Adres çubuğunda kilit ikonu → Sertifika detayları +``` + +### 3. Redirect Kontrolü + +```bash +# HTTP → HTTPS redirect +curl -I http://erp.yourdomain.com + +# Beklenen: +HTTP/1.1 301 Moved Permanently +Location: https://erp.yourdomain.com +``` + +## 🐛 Sorun Giderme + +### SSL Sertifikası Oluşturmuyor + +**Kontrol**: +1. Domain DNS'i doğru mu? + ```bash + nslookup erp.yourdomain.com + # Sunucu IP'sini göstermeli + ``` + +2. Port 80 ve 443 açık mı? + ```bash + sudo ufw status + # 80/tcp, 443/tcp ALLOW + ``` + +3. Domain'e erişilebiliyor mu? + ```bash + curl http://erp.yourdomain.com:8088 + # Site açılmalı + ``` + +**Çözüm**: +- DNS propagation'ı bekleyin (5-30 dakika) +- Dokploy'da domain'i silip tekrar ekleyin +- Firewall kurallarını kontrol edin + +### "Site not secure" Uyarısı + +**Sebep**: Sertifika henüz oluşmadı veya geçersiz + +**Çözüm**: +1. Dokploy logs kontrol edin +2. Let's Encrypt rate limit'e takılmadınızdan emin olun +3. Domain'in doğru olduğunu kontrol edin + +### Mixed Content Uyarısı + +**Sebep**: HTTPS sitede HTTP kaynak yükleniyor + +**Çözüm**: +```bash +# Site config'de force https aktif edin +bench --site set-config force_https 1 + +# Nginx config'de HSTS header'ı kontrol edin +# (Dokploy otomatik ekler) +``` + +## 📚 Dokploy SSL Özellikleri + +### Otomatik Özellikler + +✅ **Let's Encrypt Integration** +- Otomatik sertifika oluşturma +- Otomatik yenileme (90 günde bir) +- Wildcard sertifika desteği + +✅ **HTTP → HTTPS Redirect** +- Otomatik yönlendirme +- HSTS header +- Secure cookie flags + +✅ **SSL Termination** +- Proxy seviyesinde SSL +- Backend HTTP kullanır (performans) +- Zero-config + +## 🎯 Production Checklist + +### SSL İçin + +- [ ] Gerçek domain adı var +- [ ] DNS A kaydı eklendi +- [ ] Dokploy'da domain eklendi +- [ ] "Enable HTTPS" işaretlendi +- [ ] Sertifika oluşturuldu +- [ ] HTTPS erişim test edildi +- [ ] HTTP redirect çalışıyor +- [ ] Force HTTPS aktif (site config) + +### Güvenlik + +- [ ] HSTS header aktif +- [ ] Secure cookies +- [ ] TLS 1.2+ kullanılıyor +- [ ] Mixed content yok +- [ ] SSL Labs testi yapıldı (A+ rating) + +## 🔗 Yararlı Kaynaklar + +- [Dokploy SSL Docs](https://dokploy.com/docs/ssl) +- [Let's Encrypt](https://letsencrypt.org) +- [SSL Labs Test](https://www.ssllabs.com/ssltest/) +- [Mozilla SSL Config Generator](https://ssl-config.mozilla.org) + +--- + +**Son Güncelleme**: 2025-10-13 +**Versiyon**: 1.0.0 +**Frontend Port**: 8088 +**SSL**: Dokploy otomatik (Let's Encrypt) + diff --git a/dokploy/SUMMARY.md b/dokploy/SUMMARY.md index 31a53045..5cac1637 100644 --- a/dokploy/SUMMARY.md +++ b/dokploy/SUMMARY.md @@ -4,19 +4,23 @@ Bu Dokploy paketi, Frappe ERPNext'i ve 8 ek uygulamayı tek seferde deploy etmenizi sağlar. -### İçerilen Uygulamalar +### İçerilen Uygulamalar (Minimal Setup) -| Uygulama | Açıklama | Branch | -|----------|----------|--------| -| **ERPNext** | Tam özellikli açık kaynak ERP sistemi | version-15 | -| **CRM** | Müşteri İlişkileri Yönetimi | main | -| **LMS** | Öğrenme Yönetim Sistemi (e-Learning) | main | -| **Builder** | Drag & Drop Web Sitesi Oluşturucu | main | -| **Print Designer** | Özel Yazdırma Şablonu Tasarımcısı | main | -| **Payments** | Ödeme Gateway Entegrasyonları | develop | -| **Wiki** | Bilgi Tabanı ve Dokümantasyon Sistemi | main | -| **Twilio Integration** | SMS ve Telefon Araması Entegrasyonu | master | -| **ERPNext Shipping** | Kargo Firmalarıyla Entegrasyon | main | +| Uygulama | Açıklama | Branch/Tag | +|----------|----------|-----------| +| **ERPNext** | Tam özellikli ERP (Accounting, Inventory, Sales, Manufacturing) | version-15 | +| **HRMS** | İnsan Kaynakları Yönetimi (Payroll, Leave, Attendance) | version-15 | +| **CRM** | Müşteri İlişkileri Yönetimi (Lead, Deal, Contact) | main (v1.53.1) | +| **Helpdesk** | Müşteri Destek Sistemi (Ticket, SLA, Knowledge Base) | v1.14.0 | +| **Payments** | Ödeme Gateway Entegrasyonları (Stripe, PayPal, Razorpay) | main | + +**Toplam**: 5 Production-Ready Uygulama + +**Avantajlar**: +- 🚀 Hızlı build (~15-20 dakika) +- 💾 Az disk kullanımı (~4-5 GB) +- ✅ Tüm core özellikler dahil +- ✅ Frappe v15 tam uyumlu ## 🏗️ Mimari diff --git a/dokploy/apps.json b/dokploy/apps.json index e71377aa..3d4b0140 100644 --- a/dokploy/apps.json +++ b/dokploy/apps.json @@ -15,25 +15,9 @@ "url": "https://github.com/frappe/helpdesk.git", "branch": "v1.14.0" }, - { - "url": "https://github.com/frappe/lms.git", - "branch": "main" - }, - { - "url": "https://github.com/frappe/builder.git", - "branch": "main" - }, - { - "url": "https://github.com/frappe/print_designer.git", - "branch": "main" - }, { "url": "https://github.com/frappe/payments.git", "branch": "main" - }, - { - "url": "https://github.com/frappe/wiki.git", - "branch": "main" } ] diff --git a/dokploy/docker-compose.yml b/dokploy/docker-compose.yml index bee9d10a..b2f7e1d9 100644 --- a/dokploy/docker-compose.yml +++ b/dokploy/docker-compose.yml @@ -123,7 +123,7 @@ services: wait-for-it -t 120 redis-cache:6379; wait-for-it -t 120 redis-queue:6379; if [ ! -f /home/frappe/frappe-bench/sites/${SITE_NAME:-site1.localhost}/site_config.json ]; then - bench new-site ${SITE_NAME:-site1.localhost} --admin-password=${ADMIN_PASSWORD:-admin} --db-root-password=${DB_PASSWORD:-changeit} --install-app erpnext --install-app hrms --install-app crm --install-app helpdesk --install-app lms --install-app builder --install-app print_designer --install-app payments --install-app wiki --no-mariadb-socket; + bench new-site ${SITE_NAME:-site1.localhost} --admin-password=${ADMIN_PASSWORD:-admin} --db-root-password=${DB_PASSWORD:-changeit} --install-app erpnext --install-app hrms --install-app crm --install-app helpdesk --install-app payments --no-mariadb-socket; else echo "Site already exists, skipping site creation"; fi @@ -175,7 +175,7 @@ services: networks: - erpnext-network ports: - - "${HTTP_PORT:-80}:8080" + - "${HTTP_PORT:-8088}:8080" healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:8080/api/method/ping || exit 1"] interval: 30s