-
Notifications
You must be signed in to change notification settings - Fork 302
Description
Summary
We have packaged docassemble as a custom application for Cloudron, a self-hosting platform that manages applications, databases, backups, and TLS on a single server. The package is working: interviews run, the Playground functions, documents generate, and data persists across restarts.
The full write-up, including step-by-step deployment instructions, architecture decisions, and a detailed list of gotchas we encountered, is on the Cloudron forum:
Source repository: https://github.com/OrcVole/docassemble-cloudron
How it works
The package builds on top of the official jhpyle/docassemble Docker image and adapts it for Cloudron's managed environment:
- PostgreSQL and Redis are provided by Cloudron's managed addons (external to the container), connected via environment variables mapped to docassemble's config.yml.
- RabbitMQ is replaced by LavinMQ, an AMQP 0.9.1 wire-compatible broker that uses approximately 40 MB of RAM instead of 200 MB. Celery connects to it identically.
- Cloudron's reverse proxy handles TLS termination. The app runs with
BEHINDHTTPSLOADBALANCER=trueand nginx listening on port 8080. - CONTAINERROLE is set to
web:celery:cron:log:mail(notall) to prevent the init script from starting internal PostgreSQL and Redis. - The read-only filesystem is handled by symlinking approximately 25 write paths to either
/app/data/(persistent) or/run/(volatile, recreated each boot).
Where upstream changes could help
During packaging we identified a few areas where small upstream changes would make Cloudron deployment (and potentially other constrained-environment deployments) easier. These are not bugs, just observations from working through the process.
-
DAREADONLYFILESYSTEMcoverage. The flag is checked in about 25 places ininitialize.sh, which is great. However, several write operations are not gated by it (for example, writes to/etc/localtime,/etc/locale.conf,/etc/cron.daily/,/var/www/.certs,/usr/share/docassemble/webapp/syslog-ng-orig.conf). Extending the flag's coverage would reduce the number of symlinks needed for read-only environments. -
initialize.shdoes not exit after completing. After printing "Finished initializing" and starting all services, the initialize process continues running indefinitely. In our setup it consumes memory without doing further work. If this is intentional (for example, to keep supervisor from restarting it), a comment explaining why would be helpful. -
initialize.shforce-starts postgres via supervisorctl even whenCONTAINERROLEdoes not includesqland even whenDBHOSTis set to an external server. On earlier attempts we hadCONTAINERROLE=all, and the script started the internal PostgreSQL despite our supervisor override settingautostart=false. Switching toCONTAINERROLE=web:celery:cron:log:mailresolved this. -
Connection to
postgressystem database during init. The init script tests if the app database exists by connecting to thepostgresdatabase. Some managed PostgreSQL providers (including Cloudron's) only allow connections to the app-specific database, so this check fails. It is non-fatal (the script proceeds to create tables on the correct database), but generates confusing error messages in the logs.
Known limitations of the Cloudron package
- First boot takes 15-20 minutes (venv copy, database migration, package table population)
- Exim4 (email receiving) does not work due to read-only
/etc/exim4/; outbound email works via Cloudron's SMTP addon - Playground package installs persist across restarts but not across image updates
- No OIDC/SSO integration with Cloudron's user management yet
- Requires ~8 GB RAM allocated to the container
Not a feature request or bug report
This is purely informational. We wanted to let the docassemble community know that a Cloudron deployment path exists and is working, and to share our findings in case they are useful for improving constrained-environment support. The upstream observations above are minor and the existing Docker support is excellent. The BEHINDHTTPSLOADBALANCER, DAREADONLYFILESYSTEM, and external database/Redis support made this packaging work possible.
Thank you for building and maintaining docassemble.