Repository navigation
feat(deploy): EC2 deployment — Caddy, sslip.io TLS, deploy script, DEPLOYMENT.md - #4
Merged
Merged
Conversation
…PLOYMENT.md
Single-instance EC2 deployment that replaces ngrok for stable testing.
Files added:
docker-compose.prod.yml — production overlay: adds Caddy service, removes
direct host ports from checkout/messaging (Caddy handles public traffic)
Caddyfile — routes by path: /webhooks/whatsapp → messaging,
/webhooks/paystack → settlement-engine, /* → checkout.
settlement-engine's internal endpoints (/merchants, /links) are never
publicly routed (OQ-022 preserved).
deploy.sh — git pull + build + up over SSH, with health checks
scripts/ec2_setup.sh — one-shot instance provisioning: Docker install,
repo clone, ufw rules (22/80/443 only)
DEPLOYMENT.md — step-by-step: EC2 launch, sslip.io hostname derivation,
Elastic IP tradeoff, .env setup (incl. permanent WhatsApp token note),
stack start, webhook URL updates, redeploy, teardown
.env.example — adds PUBLIC_HOSTNAME, RATE_LIMIT_* vars
Approach: documented manual setup (not Terraform). Reason: single instance
that won't be replicated; Terraform adds complexity without benefit here.
Revisit when multi-instance or IaC is needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces ngrok with a stable single-instance EC2 deployment using Caddy for automatic HTTPS.
Files
docker-compose.prod.yml— production overlay:caddy_dataandcaddy_configvolumes for certificate persistenceCaddyfile— path-based routing:/webhooks/whatsapp*→ messaging:8002/webhooks/paystack→ settlement-engine:8000/*→ checkout:8001/merchants,/links,/internal/*) are never publicly routed (OQ-022 preserved)deploy.sh— repeatable redeploy over SSH:git pull+build+up -d+ health checksscripts/ec2_setup.sh— one-shot instance provisioning: Docker install, repo clone, ufw rules (22/80/443 only)DEPLOYMENT.md— complete step-by-step guide covering:.env.example— addsPUBLIC_HOSTNAME,RATE_LIMIT_*varsDesign choice: manual setup, not Terraform
Single instance that won't be replicated at this stage. Terraform adds ~200 lines and an
initdependency for no benefit here. Document revisit when multi-instance is needed.What 'done' looks like
Stack running on EC2, HTTPS working at sslip.io hostname, webhooks updated, full WhatsApp → Paystack → ledger loop verified over the real domain.