Skip to content

Production Deployment

This guide covers deploying Nyravio for production use, beyond the basic Docker installation.

Before going live:

  • Run setup.sh to 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

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

By default, Nyravio binds to 0.0.0.0:8080. For production behind a reverse proxy:

Terminal window
# Restrict to localhost only
NYRAVIO_PORT=127.0.0.1:8080

Or modify compose.yaml to bind to a specific interface.

The default compose.yaml is designed for quick start. For production, consider:

services:
nyravio:
deploy:
resources:
limits:
memory: 2g
cpus: "2"
services:
nyravio:
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"

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.

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.

Terminal window
# Quick health check
curl -sf http://localhost:8080/health/ready && echo "OK" || echo "NOT READY"

To use an external PostgreSQL instance instead of the bundled container:

  1. Install the pgvector extension on your PostgreSQL 16 server
  2. Create the database and user
  3. Update .env with connection details
  4. Remove or comment out the db service in compose.yaml
  5. Update SPRING_DATASOURCE_URL in the nyravio service environment

Flyway migrations run automatically on first startup.

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.

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

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

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