[GH-ISSUE #258] Packaging App for Cloudron #210

Closed
opened 2026-02-25 21:31:26 +03:00 by kerem · 3 comments
Owner

Originally created by @doodlemania2 on GitHub (Dec 17, 2020).
Original GitHub issue: https://github.com/ciur/papermerge/issues/258

Originally assigned to: @ciur on GitHub.

Howdy :) In my fun spare time after the kiddos go to bed, I help package amazing OSS apps for Cloudron (cloudron.io) as a hobby. There was a request to package Papermerge and since I already use your amazingness at home, thought I'd have a go at it. Cloudron has a great packaging system (docs.cloudron.io) and I've packaged a few other apps. I'm struggling with Papermerge just a tad and was wondering if you could guide me in the right direction?

In my packaging, one of the steps is to create a Dockerfile based on cloudron's base. It's currently Bionic, so not too far off. I created my Dockerfile (here). It's based tightly on your 1.4 Dockerfile. Next, I wire up a custom startup.sh which I've also got in the above repo, along with supporting config files, etc.

One of the great things about Cloudron is that it makes managing the app a snap. It does this by providing common backup/restore/upgrade functionality, as well as database and security management, cert rotation and proxying, etc. In order to do that, the app's code gets to run on a readonly filesystem. The app goes in /app/code and the data which is read/write goes in /app/data. With Papermerge using Apache + mod_wsgi, I've been trying to tear bits out of the /app/code area and put it in the read-write place (/app/data) as well as moving some other bits to /run (logs, sockets, and the like).

Here's where the wheels are coming off: The express server (which would normally run in /opt I think on your original stack?) doesn't like read only filesystem and I'm having a heck of a time getting custom configs to write various things to /app/data or /run (like the socket file).

Cloudron supports Apache and Nginx and I thought about going down the Nginix / Gunicorn route, but the rest of your docs don't say much about how best to approach that other than it should work and a few nuggets on config.

My initial stab at packaging (see repo) is by no means good - I've only spent a few hours peeling a few things apart to get it to build and launch(ish). But would love to see if you could assist in helping here. There are hundreds of customers and dozens of great apps on cloudron. With a little help, I think I can get you going there! Feel free to ping me if you like and we can connect via chat or something. Otherwise, will keep trying!

Originally created by @doodlemania2 on GitHub (Dec 17, 2020). Original GitHub issue: https://github.com/ciur/papermerge/issues/258 Originally assigned to: @ciur on GitHub. Howdy :) In my fun spare time after the kiddos go to bed, I help package amazing OSS apps for Cloudron (cloudron.io) as a hobby. There was a request to package Papermerge and since I already use your amazingness at home, thought I'd have a go at it. Cloudron has a great packaging system (docs.cloudron.io) and I've packaged a few other apps. I'm struggling with Papermerge just a tad and was wondering if you could guide me in the right direction? In my packaging, one of the steps is to create a Dockerfile based on cloudron's base. It's currently Bionic, so not too far off. I created my Dockerfile ([here](https://git.cloudron.io/doodlemania2/papermerge/-/blob/master/Dockerfile)). It's based tightly on your 1.4 Dockerfile. Next, I wire up a custom startup.sh which I've also got in the above repo, along with supporting config files, etc. One of the great things about Cloudron is that it makes managing the app a snap. It does this by providing common backup/restore/upgrade functionality, as well as database and security management, cert rotation and proxying, etc. In order to do that, the app's code gets to run on a readonly filesystem. The app goes in /app/code and the data which is read/write goes in /app/data. With Papermerge using Apache + mod_wsgi, I've been trying to tear bits out of the /app/code area and put it in the read-write place (/app/data) as well as moving some other bits to /run (logs, sockets, and the like). Here's where the wheels are coming off: The express server (which would normally run in /opt I think on your original stack?) doesn't like read only filesystem and I'm having a heck of a time getting custom configs to write various things to /app/data or /run (like the socket file). Cloudron supports Apache and Nginx and I thought about going down the Nginix / Gunicorn route, but the rest of your docs don't say much about how best to approach that other than it should work and a few nuggets on config. My initial stab at packaging (see repo) is by no means good - I've only spent a few hours peeling a few things apart to get it to build and launch(ish). But would love to see if you could assist in helping here. There are hundreds of customers and dozens of great apps on cloudron. With a little help, I think I can get you going there! Feel free to ping me if you like and we can connect via chat or something. Otherwise, will keep trying!
kerem 2026-02-25 21:31:26 +03:00
Author
Owner

@ciur commented on GitHub (Dec 17, 2020):

Hi @doodlemania2,
cloudron looks really great ! I really like the idea of Papermerge running on that platform! But I am confused about what exactly help you need ? can you please be more specific about kind of assistance you need ?

<!-- gh-comment-id:747651744 --> @ciur commented on GitHub (Dec 17, 2020): Hi @doodlemania2, cloudron looks really great ! I really like the idea of Papermerge running on that platform! But I am confused about what exactly help you need ? can you please be more specific about kind of assistance you need ?
Author
Owner

@doodlemania2 commented on GitHub (Dec 17, 2020):

Thanks so much! The biggest hurdle at the moment is getting mod_wsgi (which I have running from /app/code which is Read Only) to work nicely by storing it's generated files (and it's socket file) elsewhere. When I perform

mod_wsgi-express start-server \
            --user cloudron --group cloudron \
            --server-root /app/code \
            --url-alias /static /app/code/static \
            --url-alias /media /app/data/media \
            --port 8000 \
            --log-to-terminal \
            --limit-request-body 20971520 \
            config/wsgi.py

it tries to create tons of files in /app/code. If I could get some guidance on how I might get those bits elsewhere, that'd be great. For reference, typically persistent data would go to /app/data along with configuration files (cause they can be edited) and socketfiles would go to /run or /tmp.

From there, I may come back with more questions around using NGinx/GUnicorn instead if it would be easier, but would need guidance on how best to do that.

<!-- gh-comment-id:747663046 --> @doodlemania2 commented on GitHub (Dec 17, 2020): Thanks so much! The biggest hurdle at the moment is getting mod_wsgi (which I have running from /app/code which is Read Only) to work nicely by storing it's generated files (and it's socket file) elsewhere. When I perform ``` mod_wsgi-express start-server \ --user cloudron --group cloudron \ --server-root /app/code \ --url-alias /static /app/code/static \ --url-alias /media /app/data/media \ --port 8000 \ --log-to-terminal \ --limit-request-body 20971520 \ config/wsgi.py ``` it tries to create tons of files in /app/code. If I could get some guidance on how I might get those bits elsewhere, that'd be great. For reference, typically persistent data would go to /app/data along with configuration files (cause they can be edited) and socketfiles would go to /run or /tmp. From there, I may come back with more questions around using NGinx/GUnicorn instead if it would be easier, but would need guidance on how best to do that.
Author
Owner

@doodlemania2 commented on GitHub (Dec 21, 2020):

Any thoughts @ciur?

<!-- gh-comment-id:749136248 --> @doodlemania2 commented on GitHub (Dec 21, 2020): Any thoughts @ciur?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/papermerge#210
No description provided.