Production infrastructure & DevOps

Production Infrastructure & Deployment

Designed and deployed a Docker-based VPS environment hosting this portfolio, the Vouchers frontend and Laravel API, and the public Moja Biblioteka website across six hostnames.

Docker ComposeCaddyNginxPHP-FPMMySQLLinux VPS

Overview

One VPS hosts this portfolio, a Vouchers frontend and Laravel API, and the Moja Biblioteka website across six hostnames. The deployment case study documents HTTPS routing, application isolation and migration from a previous Compose deployment.

Infrastructure architecture

Cloudflare DNS/proxy for configured records → Caddy on ports 80 and 443. Caddy serves portfolio and product-site files, proxies the Vouchers frontend to its Nginx container, and forwards API HTTP traffic to a separate Nginx service. That service sends FastCGI requests to PHP-FPM, which accesses MySQL.

Networking, HTTPS and persistence

Only Caddy publishes web ports on the host. Caddy and public-facing Nginx services share the web network; the backend network is internal. PHP-FPM and MySQL publish no host ports. A named volume retains database data, and private environment files hold production secrets outside Git.

Engineering decisions

Separating HTTP handling from PHP execution avoids treating PHP-FPM port 9000 as an HTTP endpoint. An init service copies Laravel public assets into a shared volume for Nginx. Existing Caddy data and configuration volumes were reused during migration to retain state. The three Moja Biblioteka hostnames share a document root.

Deployment verification and rollback

Application images were built and integration-tested locally before publishing. The documented rollout checked container status, MySQL health, migration status and HTTP responses. The old Caddy container was retained as a rollback option. Four domains initially passed the health script; the two .app DNS records were later corrected and visited successfully. A subsequent six-domain health-script result is not recorded.

Outcomes and operational limits

The recorded deployment establishes service reachability and container integration. It does not establish high availability, automatic rollback or complete authenticated workflow correctness. The source identifies legacy runtime upgrades, Studio regression testing, automated database backups, monitoring and immutable image tags as follow-up work. Restoring application containers alone is not evidence of a tested database rollback.

Source evidence

Vouchers

Backend systems & production engineering