Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. App Packaging & Development
  3. Install new custom app with environment variables?

Install new custom app with environment variables?

Scheduled Pinned Locked Moved App Packaging & Development
8 Posts 4 Posters 99 Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ekevu123
    wrote last edited by
    #1

    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?

    1 Reply Last reply
    1
    • jamesJ Offline
      jamesJ Offline
      james
      Staff
      wrote last edited by james
      #2

      Hello @ekevu123
      Are these environment variables dynamic or static?
      For static environment variables, you can simply add them to the Dockerfile as ENV 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.

      1 Reply Last reply
      2
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote last edited by
        #3

        Good point.. I have added --env to cloudron install now .

        E 1 Reply Last reply
        1
        • girishG girish

          Good point.. I have added --env to cloudron install now .

          E Offline
          E Offline
          ekevu123
          wrote last edited by
          #4

          @girish Oh, really? How exactly do I use it? Do I need to upgrade the CLI?

          girishG 1 Reply Last reply
          0
          • timconsidineT Online
            timconsidineT Online
            timconsidine
            App Dev
            wrote last edited by
            #5

            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

            1 Reply Last reply
            0
            • girishG Offline
              girishG Offline
              girish
              Staff
              wrote last edited by
              #6

              @timconsidine 😄 I can make sticky post here with package updates.

              1 Reply Last reply
              1
              • E ekevu123

                @girish Oh, really? How exactly do I use it? Do I need to upgrade the CLI?

                girishG Offline
                girishG Offline
                girish
                Staff
                wrote last edited by
                #7

                @ekevu123 cloudron install --env ENV1=1 ENV2=2 --location subdomain . Then, you can verify using cloudron env list.

                E 1 Reply Last reply
                2
                • girishG girish

                  @ekevu123 cloudron install --env ENV1=1 ENV2=2 --location subdomain . Then, you can verify using cloudron env list.

                  E Offline
                  E Offline
                  ekevu123
                  wrote last edited by
                  #8

                  @girish said in Install new custom app with environment variables?:

                  @ekevu123 cloudron install --env ENV1=1 ENV2=2 --location subdomain . Then, you can verify using cloudron env list.

                  Thank you! I think this is the best solution for this problem.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Bookmarks
                  • Search