Production Deployment
This guide covers deploying Nyravio for production use, beyond the basic Docker installation.
Deployment checklist
Section titled “Deployment checklist”Before going live:
- Run
setup.shto generate unique secrets - Verify all required environment variables are set
- Configure HTTPS via reverse proxy (see Reverse Proxy & HTTPS)
- Restrict application port to localhost or internal network
- Set up automated backups (see Backup)
- Review default security settings (see Security)
- Test the full setup including model provider connectivity
Environment configuration
Section titled “Environment configuration”Required secrets
Section titled “Required secrets”All secrets must be unique per deployment. Never reuse secrets across environments.
| Variable | Purpose | Generator |
|---|---|---|
NYRAVIO_SIGNING_SECRET |
JWT token signing (≥ 32 bytes) | openssl rand -base64 48 |
NYRAVIO_ADMIN_ENCRYPTION_KEY |
Credential encryption (≥ 32 chars) | openssl rand -base64 32 |
POSTGRES_PASSWORD |
Database authentication | openssl rand -base64 24 |
Port binding
Section titled “Port binding”By default, Nyravio binds to 0.0.0.0:8080. For production behind a reverse proxy:
# Restrict to localhost onlyNYRAVIO_PORT=127.0.0.1:8080Or modify compose.yaml to bind to a specific interface.
Docker Compose hardening
Section titled “Docker Compose hardening”The default compose.yaml is designed for quick start. For production, consider:
Resource limits
Section titled “Resource limits”services: nyravio: deploy: resources: limits: memory: 2g cpus: "2"Logging
Section titled “Logging”services: nyravio: logging: driver: json-file options: max-size: "10m" max-file: "3"Restart policy
Section titled “Restart policy”The default restart: unless-stopped is appropriate for most deployments. It ensures services restart after host reboots and crashes, but respects manual docker compose stop commands.
Health endpoints
Section titled “Health endpoints”Nyravio exposes two health endpoints:
| Endpoint | Purpose |
|---|---|
/health/live |
Liveness probe — application process is running |
/health/ready |
Readiness probe — application is ready to serve requests (includes database connectivity) |
Use these in your monitoring and orchestration configuration.
# Quick health checkcurl -sf http://localhost:8080/health/ready && echo "OK" || echo "NOT READY"Database
Section titled “Database”External PostgreSQL
Section titled “External PostgreSQL”To use an external PostgreSQL instance instead of the bundled container:
- Install the pgvector extension on your PostgreSQL 16 server
- Create the database and user
- Update
.envwith connection details - Remove or comment out the
dbservice incompose.yaml - Update
SPRING_DATASOURCE_URLin the nyravio service environment
Flyway migrations run automatically on first startup.
Persistence
Section titled “Persistence”Database data is stored in the pgdata Docker volume. User uploads are stored in the uploads volume. Both must be included in your backup strategy.
Operational readiness
Section titled “Operational readiness”Backups
Section titled “Backups”Set up automated backups before accepting user data. See Backup for the complete procedure including:
- Database dump
- Uploads archive
- Environment file (encryption keys)
- Metadata with checksums
Monitoring
Section titled “Monitoring”Monitor the /health/ready endpoint. Configure alerts for:
- Application readiness failures
- Container restart events
- Disk space on database and uploads volumes
- Memory and CPU usage
Updates
Section titled “Updates”See Updates for the upgrade procedure. Key points:
- Always back up before upgrading
- Flyway migrations are forward-only — there is no automatic rollback
- Read the changelog for breaking changes before upgrading
Next steps
Section titled “Next steps”- Reverse Proxy & HTTPS — TLS termination and secure access
- Security — authentication and access controls
- Backup — data protection