|
|
3 meses atrás | |
|---|---|---|
| .claude | 3 meses atrás | |
| apps | 3 meses atrás | |
| dashboard | 3 meses atrás | |
| database | 3 meses atrás | |
| docs | 3 meses atrás | |
| mcp-server | 3 meses atrás | |
| monitoring | 3 meses atrás | |
| nginx | 3 meses atrás | |
| services | 3 meses atrás | |
| .env.example | 3 meses atrás | |
| .gitignore | 3 meses atrás | |
| API_KEYS.md | 3 meses atrás | |
| CLAUDE_DESKTOP_CONFIG.md | 3 meses atrás | |
| DASHBOARD_IMPLEMENTATION.md | 3 meses atrás | |
| DEPLOYMENT.md | 3 meses atrás | |
| IMPLEMENTATION_SUMMARY.md | 3 meses atrás | |
| README-DEPLOYMENT.md | 3 meses atrás | |
| README.md | 3 meses atrás | |
| deploy.sh | 3 meses atrás | |
| docker-compose.yml | 3 meses atrás | |
| package-lock.json | 3 meses atrás | |
| package.json | 3 meses atrás |
A record: yourdomain.com → your server IPA record: console.yourdomain.com → your server IPA record: *.yourdomain.com → your server IP (wildcard)# Clone repository
git clone https://github.com/yourusername/saas-platform.git
cd saas-platform
# Run deployment script
chmod +x deploy.sh
./deploy.sh
The script will:
https://console.yourdomain.comhttps://yourdomain.com (Hello World app)wss://console.yourdomain.com/ws# Use development environment
cp .env.development .env
cd ssl
./generate-certs.sh
cd ..
docker-compose up -d
http://localhost:8888ws://localhost:8888/wswss://localhost:8443/ws (self-signed cert warning expected).env.example (Template)Production template with placeholders. The deploy.sh script generates a .env from this.
.env.development (Local Development)Pre-configured for local development with:
.env (Active Configuration)deploy.sh with secure random passwords.env.development⚠️ Never commit .env to version control!
Ports are configurable via environment variables in .env:
| Service | Production | Development | Environment Variable |
|---|---|---|---|
| HTTP | 80 | 8888 | HTTP_PORT |
| HTTPS | 443 | 8443 | HTTPS_PORT |
| PostgreSQL | 5432 | 5432 | POSTGRES_PORT |
| Redis | 6379 | 6379 | REDIS_PORT |
Development uses ports 8888/8443 to:
.env file permissions set to 600# Database password
openssl rand -base64 32
# JWT secret
openssl rand -base64 64
# MinIO keys
openssl rand -hex 16 # Access key
openssl rand -base64 32 # Secret key
# All services
docker-compose logs -f
# Specific service
docker-compose logs -f api-service
docker-compose logs -f nginx
# All services
docker-compose restart
# Specific service
docker-compose restart api-service
# List all containers
docker-compose ps
# Check health
curl http://localhost:8888/health # Development
curl https://console.yourdomain.com/health # Production
# Connect to PostgreSQL
docker exec -it saas-postgres psql -U saas_user -d saas_platform
# Backup database
docker exec saas-postgres pg_dump -U saas_user saas_platform > backup.sql
# Restore database
cat backup.sql | docker exec -i saas-postgres psql -U saas_user -d saas_platform
# Pull latest code
git pull origin main
# Rebuild and restart
docker-compose down
docker-compose up -d --build
# Check DNS propagation
dig +short A yourdomain.com
dig +short A console.yourdomain.com
dig +short A test.yourdomain.com # Test wildcard
# Wait for propagation (can take up to 48 hours)
# Check port 80 is accessible
curl -I http://yourdomain.com
# Check Certbot logs
sudo cat /var/log/letsencrypt/letsencrypt.log
# Try manual renewal
sudo certbot renew --dry-run
# Check Docker daemon
sudo systemctl status docker
# Check logs for errors
docker-compose logs
# Rebuild containers
docker-compose down
docker-compose up -d --build
# Check if Nginx is running
docker ps | grep nginx
# Check Nginx logs
docker logs saas-gateway
# Check Nginx configuration
docker exec saas-gateway nginx -t
# Reload Nginx
docker exec saas-gateway nginx -s reload
After deployment:
| Feature | Development | Production |
|---|---|---|
| HTTP Port | 8888 | 80 |
| HTTPS Port | 8443 | 443 |
| SSL Certificates | Self-signed | Let's Encrypt |
| Passwords | Weak (for testing) | Strong random |
| Token Expiry | 24h | 15m |
| Domain | localhost | yourdomain.com |
| Node Environment | development | production |
| Hot Reload | Yes | No |
| Debug Logs | Verbose | Error only |
.env.development and access via http://localhost:8888./deploy.sh which generates .env automatically.env and database before updates.env secure with chmod 600 .envdocker-compose logs -f [service-name]curl http://localhost:8888/healthEnjoy building with the SaaS Platform! 🎉