Deployment Guide
1. Server Requirements
- OS: Ubuntu 22.04 LTS (Recommended).
- Web Server: Nginx.
- PHP-FPM: 8.2+.
- Database: MySQL 8.0 (Managed RDS recommended).
- Cache/Queue: Redis 6+.
2. Production Environment (.env)
Critical settings for production:
ini
APP_ENV=production
APP_DEBUG=false
APP_URL=https://app.olow.com
# Multi-Tenancy
CENTRAL_DOMAIN=olow.com
APP_TENANT_DOMAIN=olow.com
# Queue
QUEUE_CONNECTION=redis
# WebSockets
REVERB_APP_ID=your-app-id
REVERB_APP_KEY=your-app-key
REVERB_APP_SECRET=your-app-secret3. SSL & Domains
Since the app relies on Subdomains, you need a Wildcard SSL Certificate defined in Nginx.
nginx
server_name olow.com *.olow.com;
ssl_certificate /etc/nginx/ssl/wildcard.crt;4. Deployment Process (Manual)
- Pull Code:bash
git pull origin main - Dependencies:bash
composer install --no-dev --optimize-autoloader npm ci && npm run build - Migrations:bash
php artisan migrate --force - Cache:bash
php artisan config:cache php artisan route:cache php artisan view:cache - Restart Queues:bash
php artisan queue:restart - Start WebSocket Server:bash
php artisan reverb:start
5. Supervisor Configuration
Use Supervisor to keep queue workers and Reverb running:
ini
[program:queue-worker]
command=php /path/to/artisan queue:work redis --sleep=3 --tries=3
autostart=true
autorestart=true
[program:reverb]
command=php /path/to/artisan reverb:start
autostart=true
autorestart=true6. CI/CD Pipeline (GitHub Actions)
- Trigger: Push to
main. - Steps:
- Run Tests (Pest).
- Static Analysis (Stan/Pint).
- Deploy to Staging (Forge/Envoyer).