Deployment

Docker Compose Topology

notifito runs on a single VPS using Docker Compose. One container per application, Horizon per queue worker, Caddy as the reverse proxy.

Services

yaml
services:

# Infrastructure

postgres: # PostgreSQL 18 (port 55432)

redis: # Redis 8 (port 56379)

caddy: # Reverse proxy (port 80)

# Applications

edge: # Public API (host port 8002)

core: # Domain logic (internal only)

dispatch: # Delivery service (internal only)

dashboard: # Seller UI (internal only)

admin: # Admin panel (internal only)

# Queue workers

core-horizon: # Processes core queue

dispatch-horizon: # Processes dispatch queue

core-outbox: # Outbox relay

Caddy Routes

DomainService
edge.notifito.comedge
app.notifito.comdashboard
admin.notifito.comadmin
cdn.notifito.comstatic widget files

Internal services (core, dispatch) are not exposed to the public internet.

Production Configuration

Environment Variables

Each service needs its own .env file. Critical production variables:

env
# Core

APP_ENV=production

APP_DEBUG=false

DB_HOST=postgres

DB_DATABASE=notifito_core

INTERNAL_SECRET=<random-64-char-string>

EDGE_URL=https://edge.notifito.com

Dispatch

POSTMARK_API_KEY=<your-postmark-api-key>

POSTMARK_WEBHOOK_USERNAME=<webhook-basic-auth-user>

POSTMARK_WEBHOOK_PASSWORD=<webhook-basic-auth-pass>

Dashboard / Admin

CORE_URL=http://core:8000

INTERNAL_SECRET=<same-random-64-char-string>

Database

Queue

SSL/TLS

Caddy handles automatic HTTPS via Let's Encrypt. No manual certificate management.

Scaling Considerations

Single VPS (current)

One server runs all services. Sufficient for the initial launch and early growth.

Horizontal Scaling

When needed:

  1. Database: Move each service's database to its own server
  2. Queue: Add more Horizon workers, or move to a dedicated queue server
  3. Applications: Run multiple instances behind Caddy load balancing
  4. Cache: Move Redis to a dedicated server or use a managed service

Per-Service Scaling

Services scale independently because they have separate databases and queues:

Backups

Database

bash
# Backup core database

docker compose exec postgres pg_dump -U notifito notifito_core > core-backup.sql

Backup dispatch database

docker compose exec postgres pg_dump -U notifito notifito_dispatch > dispatch-backup.sql

Automated Backups

Set up a cron job:

bash
0 2 * * * docker compose exec -T postgres pg_dump -U notifito notifito_core | gzip > /backups/core-$(date +\%Y\%m\%d).sql.gz

0 2 * * * docker compose exec -T postgres pg_dump -U notifito notifito_dispatch | gzip > /backups/dispatch-$(date +\%Y\%m\%d).sql.gz

Monitoring

Health Checks

Each service exposes a /health endpoint:

GET /health → {"service": "core", "status": "ok"}

Observability

Alerts

Configure alerts for: