🎯 New Structure: - landing/ (root) - Only Makefile, .gitignore, .woodpecker.yml - helm/ - Kubernetes deployment (with argocd inside chart) - docker/ - Docker build configs - peikarband/ - All source code (src, tests, assets, config, tools, docs) ✅ Changes: - Moved Docker files: build/docker/ → docker/ - Moved Helm charts: deploy/helm/ → helm/ - Moved ArgoCD: deploy/argocd/ → helm/peikarband/argocd/ - Moved all source code to peikarband/ - Removed duplicate files (7 files) - Removed old empty directories 🐳 Docker Fixes: - Added npm retry configuration (fetch-retry-mintimeout, etc.) - Added 3-attempt retry mechanism for reflex export - Fixed ECONNREFUSED errors - Updated paths for new structure 📦 Config Updates: - Makefile: Updated all paths (docker/, helm/, peikarband/) - .woodpecker.yml: Updated dockerfile and context paths - .gitignore: Updated data/ path 🧪 Tests: - ✓ Helm lint passes - ✓ All paths validated - ✓ Structure verified 📊 Result: - Before: 20+ files in root, scattered structure - After: 3 files + 3 directories, clean and organized - Production-ready ✨
82 lines
2.0 KiB
Markdown
82 lines
2.0 KiB
Markdown
# Build Directory
|
|
|
|
این دایرکتوری شامل همه فایلهای مربوط به **build process** پروژه است.
|
|
|
|
## 📁 ساختار
|
|
|
|
```
|
|
build/
|
|
├── docker/ # Docker configurations
|
|
│ ├── Dockerfile # Main application Dockerfile
|
|
│ ├── Dockerfile.base # Base image reference
|
|
│ ├── docker-compose.yml # Local development
|
|
│ └── .dockerignore
|
|
└── ci/ # CI/CD configurations
|
|
└── woodpecker.yml # Woodpecker CI pipeline
|
|
```
|
|
|
|
## 🐳 Docker
|
|
|
|
### Dockerfile
|
|
Multi-stage Dockerfile برای بهینهسازی حجم image و امنیت:
|
|
- **Stage 1 (Builder)**: Build و compile
|
|
- **Stage 2 (Runtime)**: Image نهایی بدون build tools
|
|
|
|
**Build:**
|
|
```bash
|
|
make docker-build
|
|
# یا
|
|
docker build -f build/docker/Dockerfile -t peikarband/landing:latest .
|
|
```
|
|
|
|
### Dockerfile.base
|
|
فایل مرجع برای base image که در repo جداگانه build میشود:
|
|
- Repo: `peikarband/base`
|
|
- Registry: `hub.peikarband.ir/peikarband/base:latest`
|
|
|
|
### docker-compose.yml
|
|
برای development محلی:
|
|
```bash
|
|
make docker-up
|
|
# یا
|
|
docker-compose -f build/docker/docker-compose.yml up -d
|
|
```
|
|
|
|
## 🔄 CI/CD
|
|
|
|
### woodpecker.yml
|
|
Woodpecker CI pipeline configuration:
|
|
- Build Docker image
|
|
- Push به Harbor registry
|
|
- Tag with commit SHA
|
|
- Cache optimization
|
|
|
|
**تنظیمات مورد نیاز:**
|
|
- `HARBOR_USERNAME`: Harbor registry username
|
|
- `HARBOR_PASSWORD`: Harbor registry password
|
|
|
|
## 🎯 Best Practices
|
|
|
|
1. **Docker Images**
|
|
- Multi-stage builds
|
|
- Minimal runtime dependencies
|
|
- Non-root user
|
|
- Health checks
|
|
|
|
2. **CI/CD**
|
|
- Cache layers
|
|
- Automated testing
|
|
- Semantic versioning
|
|
- Registry push on main branch only
|
|
|
|
3. **Security**
|
|
- Scan images for vulnerabilities
|
|
- Sign images
|
|
- Use specific versions (no `:latest` in production)
|
|
|
|
## 📚 مستندات بیشتر
|
|
|
|
- [Deployment Guide](../docs/deployment/kubernetes.md)
|
|
- [Production Deployment](../docs/deployment/PRODUCTION_DEPLOYMENT.md)
|
|
|