- Docs
- Containers
- API
- Operations
- Deployment
API deployment¶
Authoritative deployment runbook for the TyteRide API container. Replaces stale top-level deploy details for the API.
Host and runtime¶
- Web server: CyberPanel + OpenLiteSpeed (not nginx).
- Vhost config:
/usr/local/lsws/conf/vhosts/api.tyteride.drolez-apps.cloud/vhost.conf - docRoot:
/home/api.tyteride.drolez-apps.cloud/public_html/public - Deployed checkout:
/home/api.tyteride.drolez-apps.cloud/public_html - PHP 8.3 via lsphp/lsapi; site owner
apity8249. - Database: MariaDB 10.6.22, database
tyteride. - Cache/queue/broadcast: Redis
127.0.0.1:6379.
Environment (.env key inventory)¶
Keys only; values/secrets never documented. See .env.example.
APP_ENV, APP_DEBUG, APP_URL, DB_, REDIS_, CACHE_STORE, QUEUE_CONNECTION, BROADCAST_CONNECTION, FRONTEND_URL, DASHBOARD_URL, SANCTUM_STATEFUL_DOMAINS, SESSION_, REVERB_, SMS_DRIVER, SMS_FROM, SMS_LOG_OTP_IN_PRODUCTION
Secrets (never document/copy): APP_KEY, DB_PASSWORD, REVERB_APP_KEY, REVERB_APP_SECRET, SMS_API_KEY, GOOGLE_MAPS_API_KEY, Let's Encrypt private keys.
Reverb (WebSockets)¶
- systemd unit:
tyteride-reverb.service - ExecStart:
/usr/bin/php artisan reverb:start --host=127.0.0.1 --port=8080 - OpenLiteSpeed proxies
/app/and/apps/. - Public WSS:
api.tyteride.drolez-apps.cloud:443 - Let's Encrypt certs:
/etc/letsencrypt/live/api.tyteride.drolez-apps.cloud/
Runtime services¶
tyteride-reverb.service— Reverb WebSocket server.tyteride-queue.service—php artisan queue:work(verify on host).tyteride-scheduler.timer—php artisan schedule:run(verify on host).
Deploy procedure¶
- Ensure target commit is tagged
vX.Y.Z. - Run tests:
php artisan test. - Install deps (production):
COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --optimize-autoloader - Sync release (rsync) excluding
.env,vendor/,storage/,tests/. - Fix ownership:
chown -R apity8249:apity8249on deployed checkout (verify on host). - Migrate:
php artisan migrate --force - Clear + rebuild caches:
php artisan optimize:clearphp artisan config:cachephp artisan route:cachephp artisan event:cachephp artisan view:cache- Restart Reverb:
sudo systemctl restart tyteride-reverb.service - Restart queue worker and scheduler if present (verify on host).
Seeding caveat¶
Only run TierSeeder in production. Never run DatabaseSeeder (creates a test user).
SMS fake warning¶
SMS_DRIVER=log with SMS_LOG_OTP_IN_PRODUCTION=true writes plaintext OTPs to logs. Temporary/manual testing only; disable after.
Health checks¶
- API:
GET /api/health→{"status":"ok"}; also/up. - Broadcast:
POST /api/broadcasting/authreturns 401 without auth. - Reverb: unit active and listening on
127.0.0.1:8080.
Rollback¶
Restore previous release directory, then php artisan optimize:clear and rebuild caches (config/route/event/view). Restart Reverb and queue/scheduler as needed.
Secrets¶
Never document or copy secrets: APP_KEY, DB_PASSWORD, Reverb keys, SMS_API_KEY, GOOGLE_MAPS_API_KEY, and Let's Encrypt private keys. Use .env on host only; rotate if exposed.
Pre-deploy checks¶
php artisan testgreen.- Target commit tagged
vX.Y.Z. .envpresent on host (never committed).- Database backup taken (verify on host).
Post-deploy verification¶
GET /api/healthreturns{"status":"ok"}.POST /api/broadcasting/authreturns 401 without auth.- Reverb unit active and listening on
127.0.0.1:8080. - Queue worker and scheduler running (verify on host).
Notes¶
- Do not fetch or initialize
apps/passengerorapps/driveron this host. - Deploy only tagged surface commits; never ship untagged.
- Verify host-specific service names and sudo policy before running systemctl.