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. LAMP
  3. run.sh not working as expected

run.sh not working as expected

Scheduled Pinned Locked Moved Solved LAMP
3 Posts 2 Posters 387 Views 4 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
    Eliahou
    wrote on last edited by
    #1

    Hi,

    I'm not familiar with Docker packaging and custom apps, so I'm running my small Node.js applications within the LAMP app.
    To use the latest Node.js version (since the default in the LAMP app is v18.18.0), I reinstalled Node.js in a custom path.

    I then added the following commands to the run.sh file to use my custom Node.js installation:

    export PATH="/app/data/nodejs/bin:$PATH"
    export NODE_PATH="/app/data/node_modules"
    export npm_config_prefix="/app/data"
    export npm_config_cache="/app/data/.npm-cache"
    

    However, these commands don't seem to execute automatically. Each time I open the terminal (not just when I restart the app), I have to manually enter these commands to use the custom Node.js path. It appears that the run.sh file isn't running these commands as expected, or perhaps I'm missing something.

    Could someone please advise on what I might be doing wrong or suggest a solution?

    Any help would be appreciated!
    Thanks!

    1 Reply Last reply
    1
    • J Offline
      J Offline
      joseph
      Staff
      wrote on last edited by
      #2

      @Eliahou that is expected . run.sh is only run as part of the container's start up. It's not part of "shell" start up sequence. An idea is to put those lines in /app/data/.bashrc which gets imported as part of the shell start up . You can use File manager and put that file in .bashrc or the web terminal

      E 1 Reply Last reply
      0
      • J joseph

        @Eliahou that is expected . run.sh is only run as part of the container's start up. It's not part of "shell" start up sequence. An idea is to put those lines in /app/data/.bashrc which gets imported as part of the shell start up . You can use File manager and put that file in .bashrc or the web terminal

        E Offline
        E Offline
        Eliahou
        wrote on last edited by
        #3

        @joseph
        Oh, okay! That works perfectly.
        Thank you for the clarification!

        1 Reply Last reply
        0
        • nebulonN nebulon marked this topic as a question on
        • nebulonN nebulon has marked this topic as solved on
        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