# Gold Leaf DocuSeal — deployment notes DocuSeal as a fourth user-facing service in the eDMS stack at **https://sign.zabbu.co**. Forked from `docusealco/docuseal` and tracked on the `goldleaf-custom` branch so monthly upstream merges (`git merge upstream/master`) stay clean. ## What this fork adds Only deployment scaffolding — no Rails source-code changes in Phase 1: - `docker-compose.prod.yml` — production stack (app + Postgres) routed via the shared nginx-proxy. - `.env.example` — documented secrets template. - `.github/workflows/deploy.yml` — CI/CD: build the upstream `Dockerfile`, push `servedigital/docuseal:latest`, SSH-deploy to `/opt/zabbu-sign/`. Branding (app name, logo) is applied through DocuSeal's own admin UI after the first boot. ## Architecture ``` Internet → nginx-proxy + acme-companion (/opt/goldleaf-dms/) │ proxy network (external) ▼ docuseal:3000 (servedigital/docuseal:latest) │ docuseal-internal network (internal-only) ▼ docuseal-db (postgres:18) Outbound mail: docuseal --SMTP:25--> invoice-reminder --REST--> Mailgun (proxy network, no TLS, no auth) ``` DocuSeal's bundled Caddy is **not used** — nginx-proxy handles SSL for every other service in this droplet, and we want one termination point. ## Email DigitalOcean blocks outbound SMTP, so DocuSeal points at the existing `invoice-reminder` container (extended with an SMTP→Mailgun relay) instead of contacting an SMTP server directly. Required reading: `edms-invoice-reminder-service/README.md` → "Internal SMTP relay". DocuSeal env vars used: | Var | Value | Source | |---|---|---| | `SMTP_ADDRESS` | `invoice-reminder` | container DNS on `proxy` network | | `SMTP_PORT` | `25` | the relay's listen port | | `SMTP_DOMAIN` | `zabbu.co` | EHLO domain | | `SMTP_ENABLE_STARTTLS` | `false` | local network, no need | | `SMTP_ENABLE_SSL` / `SMTP_ENABLE_TLS` | `false` | same | | `SMTP_USERNAME` / `SMTP_PASSWORD` | (unset) | relay accepts unauthenticated mail | DocuSeal's default From header is `DocuSeal `. Mailgun rejects mail whose From domain isn't on a verified domain, so **after first boot** set the per-account "Send from Email" in DocuSeal's admin UI (Account settings → Send from Email) to a verified Mailgun address (e.g. `sign@mg.servedigital.io`). The relay also rewrites unmatched From addresses to `MAILGUN_FROM` as a safety net, but explicit configuration is cleaner. ## First-time VPS setup (one-shot) ```bash ssh zabbu@46.101.144.7 sudo mkdir -p /opt/zabbu-sign sudo chown zabbu:zabbu /opt/zabbu-sign cd /opt/zabbu-sign ``` Copy the compose file from your laptop: ```bash scp docker-compose.prod.yml zabbu@46.101.144.7:/opt/zabbu-sign/docker-compose.yml ``` Create `/opt/zabbu-sign/.env`: ```bash cat > /opt/zabbu-sign/.env <> .env < /opt/zabbu-sign/pgdata-backup.sql tar -czf docuseal-$(date +%F).tar.gz \ /opt/zabbu-sign/data /opt/zabbu-sign/pgdata-backup.sql # then s3cmd put → DO Spaces ```