My App
Production

Production Overview

ClayDiary runs on a single rented server (a VPS at Contabo). Docker containers hold the application, and Caddy is the only public entry point.

ClayDiary production: a browser reaches Caddy over HTTPS through the firewall; Caddy routes by hostname to the frontend, API, Grafana and documentation containers; PostgreSQL and Prometheus stay private. A delivery path runs from the developer through GitHub Actions and the image registry to a manual deploy step.
  • One server: the whole stack runs on one VPS with Docker Compose. At this scale it needs no Kubernetes or cloud platform. A managed platform (Render) was tried first and dropped because its database is not free.
  • Seven containers:
    • API
    • Frontend (served by Nginx)
    • PostgreSQL with TimescaleDB
    • Prometheus
    • Grafana
    • Documentation site
    • Discord bot (optional)
  • Caddy at the edge: it runs on the server itself, not in a container. It routes requests by hostname to the application, Grafana or the documentation site, sends API calls to the backend, and obtains and renews HTTPS certificates automatically.
  • Network exposure: the firewall allows only SSH, HTTP and HTTPS. Every container port is bound to localhost, so Caddy is the only way in from the internet.
  • Private services: PostgreSQL and Prometheus have no public address. The database is reached from a laptop through Tailscale or an SSH tunnel.
  • Delivery: CI checks the code and publishes images tagged with the commit. A manually started deploy pulls them, applies database migrations, restarts the API and frontend, and waits for their health checks. The documentation site has its own pipeline.

Next: Containers and Compose, Server and network, CI/CD and Monitoring.