Install new custom app with environment variables?
-
When I install a new custom app using cloudron cli, I use cloudron build to build it and then cloudron install --location PATH --image IMAGE
However, for the installation process tu run through successfully, it requires to have environment variables set at that time.
I only know that I can set these variables using cloudron env set.
So, my current strategy is to run cloudron install, let it fail, terminate the process, set the environment variables, and then run cloudron update with the same image, which works.
I suppose the ideal solution would be to somehow use cloudron install but with environment variables set in the process.
Or should I simply set fallbacks and override them afterwards?
What's the best process for this?
-
Hello @ekevu123
Are these environment variables dynamic or static?
For static environment variables, you can simply add them to the Dockerfile asENV
https://docs.docker.com/reference/dockerfile/#env
These will also exist in the app itself.Example https://git.cloudron.io/packages/docker-registry-app/-/blob/master/Dockerfile?ref_type=heads#L6
ENV BUILDTAGS include_oss include_gcs
Inside the web-terminal of the docker-registry-app:
/app/code# echo $BUILDTAGS include_oss include_gcs
Dynamic ones need to be set by the startup script of the app.
-
out of interest, is there a CHANGELOG for the cloudron CLI ? I mean, how we know if we have the latest version, and what changes are in it
-
@ekevu123
cloudron install --env ENV1=1 ENV2=2 --location subdomain
. Then, you can verify usingcloudron env list
.