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. Support
  3. How to add files into /app/data?

How to add files into /app/data?

Scheduled Pinned Locked Moved Solved Support
3 Posts 2 Posters 670 Views 1 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.
    • saikarthikS Offline
      saikarthikS Offline
      saikarthik
      wrote on last edited by saikarthik
      #1

      How do you add files into /app/data from inside a docker container?

      Please point me to a sample repo if it exists on git.cloudron.io. Couldnt find one myself.

      1 Reply Last reply
      0
      • nebulonN Offline
        nebulonN Offline
        nebulon
        Staff
        wrote on last edited by
        #2

        When an app is installed, /app/data is mounted as a volume into the container, so things have to be added during runtime there. For packaging related data or initial config file templates, this usually is done in the apps entry point script (mostly called start.sh)

        For example surfer needs a public folder in /app/data so this happens at https://git.cloudron.io/cloudron/surfer/-/blob/master/start.sh#L8

        1 Reply Last reply
        2
        • saikarthikS Offline
          saikarthikS Offline
          saikarthik
          wrote on last edited by saikarthik
          #3

          @nebulon Thanks!

          For anyone else, this is how I did it.

          In 'Dockerfile', I added the files into the /app/code directory using:

          COPY public /app/code/temp-public
          

          Then, in 'start.sh' I added the following to ensure it only copies files over on first run:

          if [[ -z "$(ls -A /app/data/public)" ]]; then
              echo "==> Add public files on first run"
              cp -r /app/code/temp-public/* /app/data/public/
          else
              echo "==> Do not override existing public folder"
          fi
          
          1 Reply Last reply
          2
          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