App with multiple endpoints. How to share addons?
-
I don't know the answer but I'd look for clues in the packages of other apps with multiple end points like eg Minio (I think)
-
For this you probably want to use the
multiDomain
feature https://docs.cloudron.io/packaging/manifest/#multidomainOr also if one of the two processes can work off a subpath of the same domain, you may add a reverse proxy in the app to proxy pass to the corresponding internal server?
-
This post is deleted!
-
Is the container run in read-only mode?
My start script need to create a file but I keep getting the error: "touch: cannot touch './builder/apps/builder/public/__env.js': Read-only file system"
I tried to specifically enable all modes to that public folder with
RUN chmod 777 -R ./builder/apps/builder/public && chmod 777 -R ./viewer/apps/viewer/public
. But that just won't do it.Here are the files: https://github.com/baptisteArno/typebot.io/pull/550/files
Am I missing something?
-
@baptistearno make sure to se it up to run from
/app/data
and not/app/code
-
@robi I tried to run the script from the
/app/data
folder (https://github.com/baptisteArno/typebot.io/pull/550/commits/6da7ade5dd4a4f24c6185472b66df0715c94c6a5#diff-f04ded0885f91a28ae388b09ec3477ec378337f483257bf22e0eaf813c3704e5) but no luck.Still getting:
touch: cannot touch './builder/apps/builder/public/__env.js': Read-only file system
Did I understand correctly what you suggested?
-
So in Cloudron only the folders
/app/data
,/run/
and/tmp
/ are write-able. The app code should remain in read-only storage, but if an app needs to write to disk, then depending on the use-case one of those 3 folders should be symlinked or configured to be used. Note that only/app/data
will get backed up. -
@baptistearno looks like you need to adjust the ENVSH_* variables to something more appropriate to what @nebulon said.
-
EDIT: fixed! I increased the container resources
Thank you for the help guys @robi @nebulon, I'm almost there!
Now, I have an issue with running the 2 apps using supervisor. Here is the final logs:
Jun 09 12:56:36 ==> Starting supervisor Jun 09 12:56:37 2023-06-09 10:56:37,243 INFO Included extra file "/etc/supervisor/conf.d/builder.conf" during parsing Jun 09 12:56:37 2023-06-09 10:56:37,244 INFO Included extra file "/etc/supervisor/conf.d/viewer.conf" during parsing Jun 09 12:56:37 2023-06-09 10:56:37,244 INFO Set uid to user 0 succeeded Jun 09 12:56:37 2023-06-09 10:56:37,250 INFO supervisord started with pid 1 Jun 09 12:56:38 2023-06-09 10:56:38,255 INFO spawned: 'builder' with pid 195 Jun 09 12:56:38 2023-06-09 10:56:38,258 INFO spawned: 'viewer' with pid 196 Jun 09 12:56:39 - info Loaded env from /app/code/viewer/apps/viewer/.env.production Jun 09 12:56:39 2023-06-09 10:56:39,738 INFO success: viewer entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) Jun 09 12:56:39 2023-06-09 10:56:39,787 INFO reaped unknown pid 184 (exit status 0) Jun 09 12:56:39 Listening on port 3001 url: http://b02f726c-1c16-4a23-bfad-9ce3f23df732:3001 Jun 09 12:56:40 - info Loaded env from /app/code/builder/apps/builder/.env.production Jun 09 12:56:40 2023-06-09 10:56:40,077 INFO success: builder entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) Jun 09 12:56:40 => Healtheck error: Error: connect ECONNREFUSED 172.18.20.229:3000 Jun 09 12:56:43 Listening on port 3000 url: http://b02f726c-1c16-4a23-bfad-9ce3f23df732:3000 Jun 09 13:00:49 - info Loaded env from /app/code/builder/apps/builder/.env.production email undefined localstorage undefined postgresql undefined
It seems to properly launch the 2 apps but then it doesn't succeed in doing the health check.
The server seems to be slow… The logs take some time to load etc… but when I check the resource usage, it is just fine:Is the container restricted in terms of resource?
Here are the new files: https://github.com/baptisteArno/typebot.io/pull/550/commits/c307635148b04184d12795614a98cedec81d2d9b
-
thanks for the work @baptistearno
by default each app has a memory limit set at 256MB, in your manifest
CloudronManifest.json
you can adjust this default value for your app. -
@baptistearno Just saw https://docs.typebot.io/self-hosting/cloudron . This is awesome!
Are you open to having the app published on the App Store ? If so, I can create a repo in our gitlab, give you permissions as well and we can proceed to get it published. Note that GitLab is only for the cloudron package and not for your app development (which can continue wherever you want).
-
@baptistearno Man, this is so great. Looks like a lot of work was put in. Awesome job, and thanks for the effort!