Single compose file for Coolify: MariaDB, Redis, idempotent site creation, migrations on redeploy, SERVICE_URL_FRONTEND_8080 routing, and Forgejo Actions readiness validation vendored from production-ci-readiness skill.
2.9 KiB
2.9 KiB
Coolify deployment — Production ERPNext
Prerequisites
- Coolify v4+ with Docker Compose support
- Server: minimum 4 GB RAM, 8 GB+ for production workloads
- Public domain (e.g.
erp.yourdomain.com)
1. Create the Coolify service
| Setting | Value |
|---|---|
| Type | Docker Compose |
| Repository | https://git.aexoradao.com/epistemophiliac/production-erpnext |
| Branch | main |
| Compose file | docker-compose.yml |
2. Environment variables
Set these in Coolify → Service → Environment Variables before first deploy:
| Variable | Required | Example | Notes |
|---|---|---|---|
ERPNEXT_VERSION |
yes | v16.22.0 |
Pin image tag |
DB_PASSWORD |
yes | strong secret | MariaDB root |
SITE_NAME |
yes | erp.yourdomain.com |
Must match domain |
ADMIN_PASSWORD |
yes | strong secret | Frappe login |
FRAPPE_SITE_NAME_HEADER |
yes | same as SITE_NAME |
Single-site routing |
MIGRATE_SITES |
no | true |
Run migrate on redeploy |
Coolify env cache: Changing defaults in
docker-compose.ymldoes not update values already stored in Coolify. Edit them in the UI after changes.
3. Domain routing
- Open the deployed service in Coolify
- Add domain:
erp.yourdomain.com - Attach domain to service
frontend - Internal port:
8080(Frappe nginx — not 80)
The compose file sets SERVICE_URL_FRONTEND_8080 so Coolify routes HTTPS to nginx correctly.
4. First deploy timeline
db (healthy) → redis → configurator (exit 0)
→ create-site (new-site + install-app erpnext, ~5–15 min)
→ migrator → backend / workers / frontend
Watch logs:
create-site— site creation progressbackend— gunicorn readyfrontend— nginx on 8080
5. Post-deploy verification
From Coolify terminal on frontend:
curl -sI http://localhost:8080/
From your machine:
curl -sI https://erp.yourdomain.com/
Login at https://erp.yourdomain.com — user Administrator.
6. Upgrades
- Bump
ERPNEXT_VERSIONin Coolify env vars - Redeploy —
migratorrunsbench --site all migrate - Confirm
migratorlogs show success
Troubleshooting
| Symptom | Fix |
|---|---|
| Coolify 404 | Domain on wrong service — must be frontend:8080 |
| Site not found | SITE_NAME ≠ domain; fix FRAPPE_SITE_NAME_HEADER in UI |
| Stack unhealthy | Healthcheck port must be 8080 on frontend |
| create-site fails on redeploy | Should be idempotent — check sites/$SITE_NAME exists |
| Env change ignored | Update variable in Coolify UI, not only in git |
What we intentionally omit
- No Traefik / nginx-proxy / Let's Encrypt in compose — Coolify handles TLS
- No
ports:— Coolify proxy only - No
pwd.ymldemo stack
CI / production gate
Every merge to main must pass .github/workflows/production-readiness.yml before Coolify auto-deploy (if wired).
Local check:
make ci