Configuration and deployment #
Structuring variables #
APP_ENV, APP_DEBUG, APP_SECRET, APP_URL, DATABASE_URL, REDIS_URL, MESSENGER_TRANSPORT_DSN, JWT keys and VITE_API_URL. Never publish .env or a secret value.
HTTPS and reverse proxy #
Docker serves HTTP on 8080. Model nginx.conf.example terminates TLS 1.2/1.3, redirects HTTP, enables HSTS, and passes HTTPS context. APP_URL must match the public origin for OAuth callbacks.
Persistence and services #
Back up PostgreSQL, Redis, isms_document_files and jwt_keys. The worker processes emails; The scheduler expires acceptances and recalls journals. Mailpit is disabled in production.
Compose profiles object-storage and antivirus optionally enable MinIO and ClamAV. Run migrations on each release and check /api/health. Never load fixtures in production.
Step-by-step deployment #
- Prepare DNS and certificate.
- Create
.envfrom the example without versioning it. - Set unique secrets and
APP_URL=https://riskpilot.site. - Start with the two Compose files.
- Apply migrations as a controlled task.
- Check health, connection, email, documents and export.
- Enable traffic through the reverse proxy.
Worker and scheduler #
The worker consumes the notifications; the scheduler processes expirations and callbacks. Check automatic restart, memory, logs and queue depth. An application accessible with a stopped worker remains functionally degraded.
Document storage #
The private volume is the default. S3/MinIO requires bucket, private access, encryption, backup and lifecycle policy. ClamAV adds optional scanning but does not replace type, size and signature checks.
Update and rollback #
Back up before migration, note image versions and test the restoration. A code rollback with a newer schema must be explicitly compatible; Do not downgrade the database without a planned migration.
Pre-production checks #
Run ./scripts/check-production-env.sh .env before every release. It validates presence and strength of critical variables without displaying their values. It complements rather than replaces secret management, controlled migrations, reverse-proxy TLS and /api/health testing.
After deployment, LOAD_REQUESTS=100 LOAD_CONCURRENCY=10 LOAD_MAX_P95_MS=750 ./scripts/load-smoke.sh https://riskpilot.example.com checks availability and a basic p95 threshold. This anonymous check does not replace an authenticated business journey. On a small demo, Messenger recycles its PHP process periodically and its healthcheck verifies the actual consumer so the queue is not silently left idle.