Anyone added a custom app to their cloudron?
-
I have looked at the tutorial https://github.com/M-arcus/cloudron-docs/blob/master/developer/docs/packaging.md
And found it rather hard to follow, even the first line to type doesn't make it clear you shouldn't be running it on the server!
Also I've not done any docker stuff before, so the basics of it are already over my head, and the links in the tutorial are also broken..
ie https://github.com/M-arcus/cloudron-docs/blob/master/developer/baseimage
However I found https://git.cloudron.io/docs/tutorial-basic/-/blob/master/Dockerfile?ref_type=headsI'm hoping someone with experience could give some guidance on getting a custom app installed. (my chosen app is https://github.com/HiEventsDev/Hi.Events/tree/develop)
Which already has a dockerfile, which I guess has to be edited to meet the requirements of cloudron.
Do I need to create a git account & put my custom app files on github to make this work ? -
The rendered version of the docs is at https://docs.cloudron.io/packaging/tutorial/ . The repo itself is https://git.cloudron.io/docs/docs .
Not a packager myself, so I cannot answer entirely. But see https://forum.cloudron.io/topic/2843/read-first-before-starting-to-package-an-app and https://forum.cloudron.io/topic/3102/building-custom-packages . You don't need git or github for all this.
-
I have looked at the tutorial https://github.com/M-arcus/cloudron-docs/blob/master/developer/docs/packaging.md
And found it rather hard to follow, even the first line to type doesn't make it clear you shouldn't be running it on the server!
Also I've not done any docker stuff before, so the basics of it are already over my head, and the links in the tutorial are also broken..
ie https://github.com/M-arcus/cloudron-docs/blob/master/developer/baseimage
However I found https://git.cloudron.io/docs/tutorial-basic/-/blob/master/Dockerfile?ref_type=headsI'm hoping someone with experience could give some guidance on getting a custom app installed. (my chosen app is https://github.com/HiEventsDev/Hi.Events/tree/develop)
Which already has a dockerfile, which I guess has to be edited to meet the requirements of cloudron.
Do I need to create a git account & put my custom app files on github to make this work ?@AartJansen don’t fear, it’s easy once you know how :-).
But yes knowing how is a small learning curve.Most important thing is the original app needs to be packaged for Cloudron.
I’m not sure the app you quoted has been.
Most packaged and ready to install apps are on git.cloudron.io.- Package the app - that’s the tricky bit.
- or find already packaged one and clone that to your local device.
- Make you have Cloudron CLI installed and logged in.
- Build the docker image and push to a docker registry
- Do ‘cloudron install —image dockerrepo.domain.tld/appname:version’ which will prompt you for the location (subdomain.domain.tld) where you want it.
Sorry if that’s too Basic
Ask if not detailed enough -
Hi.events doesn’t seem too complex to package but I’m on the road so can’t look at it now
-
I have a small script to do the build & install, which I will upload later.
Very simple but saves some typing. -
We have submitted two apps to cloudron, and we run multiple instances of both of them:
- https://git.nostrdev.com/stuff/strfry-cloudron (originally submitted by @sebdev )
- https://git.nostrdev.com/stuff/blossom-cloudron
-
I did once for my own app, giving examples is maybe not worth it as every app is its own beast. However I used LLM Prompt for such task.
After I came up with a basic Dockerfile and script (shell) for building/running my app, I created a giant prompt including all the key config files for my app, including also a copy of the whole relevant documentations from Cloudron for packaging any app, as well as some examples of already packaged Cloudron app with same tech (there are a few https://git.cloudron.io/cloudron/)Based on that, I could already have a very good starting point
My prompt was something like :
I have a Pythonic app for Cloudron, called <NAME> I'd like to package it for my Cloudron, I've already a Cloudron Docker registry. Here is my <config/something.conf> file <CODE HERE> Here is my requirements.txt file listing all my app dependencies <REQUIREMENTS.TXT CONTENT HERE> Here is my Dockerfile <DOCKERFILE CONTENT HERE> Here is my docker-compose file <DOCKER-COMPOSE CONTENT HERE> Here are examples of CloudronManifest.json for python apps: <INSERT EXAMPLE 1 HERE> <INSERT EXAMPLE 2 HERE> <INSERT EXAMPLE 3 HERE> ... Also the official cheatsheet for packaging apps in general for Cloudron <COPY CONTENT FROM https://docs.cloudron.io/packaging/cheat-sheet/ HERE> Another tutorial for packaging is : <COPY CONTENT FROM https://docs.cloudron.io/packaging/tutorial/ here, excluding the "Next steps" section at the end > Here are examples of start.sh scripts from other Python apps: <INSERT EXAMPLE 1 HERE> And <INSERT EXAMPLE 2 HERE> Now if you need more files examples from some python app, let me know which could help and I provide them. other stuff like start.sh? Please STOP and ask first for all the files you need to know before giving the full step by step guide to package my app. I'm interested into Cloudron addons, which one could fit my app for now?
Then the LLM asked me for more info, I filled the info, then I did lot of progress around packaging my app. It is far from being perfect, but if you are not wanting to waste time coding, at least be efficient while being lazy
-
I did once for my own app, giving examples is maybe not worth it as every app is its own beast. However I used LLM Prompt for such task.
After I came up with a basic Dockerfile and script (shell) for building/running my app, I created a giant prompt including all the key config files for my app, including also a copy of the whole relevant documentations from Cloudron for packaging any app, as well as some examples of already packaged Cloudron app with same tech (there are a few https://git.cloudron.io/cloudron/)Based on that, I could already have a very good starting point
My prompt was something like :
I have a Pythonic app for Cloudron, called <NAME> I'd like to package it for my Cloudron, I've already a Cloudron Docker registry. Here is my <config/something.conf> file <CODE HERE> Here is my requirements.txt file listing all my app dependencies <REQUIREMENTS.TXT CONTENT HERE> Here is my Dockerfile <DOCKERFILE CONTENT HERE> Here is my docker-compose file <DOCKER-COMPOSE CONTENT HERE> Here are examples of CloudronManifest.json for python apps: <INSERT EXAMPLE 1 HERE> <INSERT EXAMPLE 2 HERE> <INSERT EXAMPLE 3 HERE> ... Also the official cheatsheet for packaging apps in general for Cloudron <COPY CONTENT FROM https://docs.cloudron.io/packaging/cheat-sheet/ HERE> Another tutorial for packaging is : <COPY CONTENT FROM https://docs.cloudron.io/packaging/tutorial/ here, excluding the "Next steps" section at the end > Here are examples of start.sh scripts from other Python apps: <INSERT EXAMPLE 1 HERE> And <INSERT EXAMPLE 2 HERE> Now if you need more files examples from some python app, let me know which could help and I provide them. other stuff like start.sh? Please STOP and ask first for all the files you need to know before giving the full step by step guide to package my app. I'm interested into Cloudron addons, which one could fit my app for now?
Then the LLM asked me for more info, I filled the info, then I did lot of progress around packaging my app. It is far from being perfect, but if you are not wanting to waste time coding, at least be efficient while being lazy
@SansGuidon That’s a very good point about using an AI engine to help create a Dockerfile suitable for Cloudron.
And thank you for sharing your prompts for this.Reciprocally, this the initial prompt I use :
I want to package an app from a Github repo for use on an instance of the Cloudron PaaS.
Packaging an app for Cloudron requires a Dockerfile which uses the current Cloudron base image 4.2.0, and which separates read-only executable code under /app/code and read-write files such as configuration files and app data under /app/data.
It also requires a CloudronManifest.json file with information to allow Cloudron to install the image built from the Dockerfile.
The CloudronManifest.json file allows addons for e.g. local storage and database connections such as mongodb and postgres.
Note that files stored in /app/data during the docker build do not persist when the image is installed or restarted in the Cloudron PaaS. Therefore they should be placed in e.g. /tmp/data and then copied from there to /app/data in start.sh if they do not already exist there.
Additionally in order to facilitate upgrades when the source repo is updated, the repo should be pulled from the latest release of the rep and extracted within the Dockerfile. The source repo should not be cloned locally.
The only files which should exist in this local project are Dockerfile, CloudronManifest.json, start.sh, logo.png (for the app icon), and LICENCE.md (copied from the relevant repo licence fle).
Please help me create the Dockerfile (check the repo for the author’s version and use it with modifications), CloudronManifest.json and start.sh, which comply with these requirements.
The app's repo is at xxxxxxx and the latest release is xxxxxxxHope this helps someone.
-
I mentioned earlier using a script to manage the docker build and cloudron install.
This uses 2 command line prompts : the docker registry address/image name and optionalcache
(without it, the scripts builds freach without cache each time).#!/bin/bash if [ "$#" -lt 1 ]; then echo "Usage: $0 <image-name> [cache]" exit 1 fi if [ "$2" = "cache" ]; then echo "Building with cache ..." docker build -t $1 . else echo "Building with no cache ..." docker build --no-cache -t $1 . fi docker push $1 cloudron install --image $1
Hope this helps someone