Skip to content
Case study

How I built and deployed REZZA

How a production SaaS platform, WordPress properties, monitoring, backups, deployment environments, and constrained AI operations were consolidated onto a hardened Docker-based VPS architecture.

Executive summary

I built REZZA as an operating platform for service businesses. I moved production workloads from managed hosting into a self-controlled environment designed for clearer operations, staging safety, monitoring, recovery, and secure AI-assisted operations.

Initial situation

The application and WordPress properties were distributed across managed providers. That model offered convenience, but limited infrastructure control, tied deployments to platform conventions, and fragmented visibility. The migration was a tradeoff: more control and portability in exchange for direct operational responsibility.

Objectives

  • Move production to a self-managed VPS
  • Build separate staging
  • Preserve and safely restore PostgreSQL data
  • Deploy background workers
  • Move WordPress properties
  • Implement HTTPS and reverse proxying
  • Harden the server
  • Centralize monitoring and alerting
  • Establish backups and verification
  • Create repeatable operations
  • Add bounded, read-only AI-assisted investigation
  • Prepare for future AI workloads and clients

Target architecture

Production uses a Python/Flask web application behind Gunicorn, PostgreSQL, a background worker, and persistent application data. Staging has separate containers, data, variables, protected access, and no-index headers. WordPress sites use separate containers, MariaDB databases, and private networks. Prometheus, Grafana, Node Exporter, cAdvisor, and Blackbox Exporter supply operational visibility. Portainer is protected, and the Docker socket is never publicly exposed.

Migration phases

  1. VPS provisioning
  2. Ubuntu updates and baseline hardening
  3. SSH hardening
  4. Firewall configuration
  5. Fail2ban
  6. Docker installation
  7. Reverse proxy and TLS
  8. WordPress migration
  9. REZZA staging deployment
  10. PostgreSQL migration
  11. Production deployment
  12. Background worker deployment
  13. DNS cutover
  14. Monitoring
  15. Backups
  16. Staging certification and restored-production rehearsal
  17. Constrained operations control plane
  18. Read-only capacity investigation
  19. Validation
  20. Previous platform suspension after verification
  21. Documentation and operational review

Challenges and resolutions

Database transaction failures

A failed statement can leave a database transaction unusable until rollback. Diagnosis focused on the first error, explicit rollback behavior, and making data operations safe to retry.

Environment-variable gaps

Mail, payment, security, and service settings can affect startup or individual features. A configuration inventory and validation process caught omissions without exposing values.

CORS and CSP

Broad policies expose unnecessary origins; overly narrow policies break legitimate behavior. First-party origins and required connections were explicitly scoped.

Reverse proxy and trusted hosts

Host validation and forwarded headers were aligned so the application could identify legitimate HTTPS requests without trusting arbitrary headers.

Docker networking

Databases and internal services stayed on private networks. Public bindings were limited to the reverse-proxy path and explicitly required management access.

Git branch and deployment separation

Staging and production use distinct branches, settings, databases, and deployment steps to prevent accidental cross-release.

Evidence versus inference

Operational measurements were classified as KNOWN, LIKELY, POSSIBLE, or UNKNOWN. A large category could justify investigation, but never an automatic claim about root cause.

Operational authority

Read-only observation was separated from remediation. Fixed wrappers exposed bounded aggregates while deletion, restart, arbitrary paths, secrets, and raw infrastructure control remained unavailable.

DNS cutover

Records, TTLs, certificates, application readiness, and rollback were sequenced before traffic moved.

WordPress migration

Files and databases were moved together, URLs and permissions validated, and each site retained an isolated network and database.

Secure AI operations

The operations control plane answers narrowly defined owner questions with fixed, read-only measurements. For disk pressure, it can compare aggregate Docker, database, backup, log, application-storage, and residual usage without exposing filenames, credentials, environment files, database contents, or the Docker socket.

Evidence and action are intentionally separate. Findings preserve uncertainty, and any cleanup, restart, configuration change, or production mutation requires a distinct owner-authorized workflow.

Outcomes

The migration produced greater infrastructure control, reduced vendor dependency, isolated environments, centralized monitoring, stronger security visibility, a repeatable deployment workflow, certification gates, and a constrained foundation for AI-assisted operations.

Lessons

Infrastructure ownership is valuable only when paired with disciplined patching, observability, tested recovery, documentation, and clear operational responsibility. AI can improve evidence gathering, but it should not erase uncertainty or blur the boundary between investigation and action.

Get in touch

What are you building or running?

Tell me what you want to build, what needs reviewing, or where you need help with hosting and maintenance.

Discuss Your Project