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. read-only file system, rmdir '/dist'

read-only file system, rmdir '/dist'

Scheduled Pinned Locked Moved App Packaging & Development
8 Posts 3 Posters 1.2k Views 3 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.
  • S Offline
    S Offline
    Simon-Piquemal
    wrote on last edited by
    #1

    Hi, I need information on how to get around this problem. I created a docker file that I deployed on the Cloudron server but I get this error message towards the end:
    Aug 04 16:58:17
    Aug 04 16:58:18
    Aug 04 16:58:24 2024-08-04T14:58:24.000Z
    Aug 04 16:58:24 2024-08-04T14:58:24.000Z
    Aug 04 16:58:24 > exemple@0.0.1 start:dev
    Aug 04 16:58:24 > nest start --watch
    Aug 04 16:58:27 => Healtheck error: Error: Timeout of 7000ms exceeded
    Aug 04 16:58:28 2024-08-04T14:58:28.000Z
    Aug 04 16:58:28 Error EROFS: read-only file system, rmdir '/dist'
    Aug 04 16:58:28
    Aug 04 16:58:28 \

    To give you a little more detail, this is a nestjs project, so when the image is built, the typescript is compiled and put in another folder to run, and I also have files that are written and read inside (it's a pdf generation from a url).

    1 Reply Last reply
    1
    • BrutalBirdieB Offline
      BrutalBirdieB Offline
      BrutalBirdie
      Partner
      wrote on last edited by
      #2

      https://docs.cloudron.io/packaging/cheat-sheet/#read-only

      You may need to make /dist a symlink to /app/data or /run

      Like my work? Consider donating a drink. Cheers!

      1 Reply Last reply
      1
      • S Offline
        S Offline
        Simon-Piquemal
        wrote on last edited by
        #3

        Thank you, I'll take a look at it and get back to you as soon as possible. Thank you 🙂

        1 Reply Last reply
        1
        • S Offline
          S Offline
          Simon-Piquemal
          wrote on last edited by Simon-Piquemal
          #4

          EROFS: read-only file system, rmdir '/dist'
          Aug 04 21:50:38
          Aug 04 21:50:38
          Aug 04 21:50:39 2024-08-04T19:50:39.000Z
          Aug 04 21:50:39 2024-08-04T19:50:39.000Z
          Aug 04 21:50:39 > apibetterhost@0.0.1 start:dev
          Aug 04 21:50:39 > nest start --watch
          Aug 04 21:50:39 Done.
          Aug 04 21:50:39 Fresh installation, setting up data directory...
          Aug 04 21:50:39 chown: cannot access '/app/data': No such file or directory
          Aug 04 21:50:39 touch: cannot touch '/app/data/.initialized': No such file or directory
          Aug 04 21:50:40 => Healtheck error: Error: connect ECONNREFUSED (myipadresse):3000

          Dockerfile:

          
          FROM node:20
          
          
          RUN apt-get update && apt-get install -y \
              libnss3 \
              libatk1.0-0 \
              libatk-bridge2.0-0 \
              libcups2 \
              libxcomposite1 \
              libxdamage1 \
              libxrandr2 \
              libgbm1 \
              libasound2 \
              libpangocairo-1.0-0 \
              libpangoft2-1.0-0 \
              libpango1.0-0 \
              libx11-xcb1 \
              libx11-6 \
              libxext6 \
              libxfixes3 \
              libxrender1 \
              libxshmfence1 \
              ca-certificates \
              fonts-liberation \
              libappindicator3-1 \
              libnspr4 \
              libxss1 \
              lsb-release \
              xdg-utils \
              wget \
              ghostscript \
              && rm -rf /var/lib/apt/lists/*
          
          
          RUN npx playwright install
          
          
          WORKDIR /
          
          
          COPY package*.json ./
          
          RUN npm install
          
          RUN npm install gsx-pdf-optimize --global
          
          COPY . .
          
          RUN npm run build
          
          RUN mkdir -p /run/app
          
          RUN mkdir -p /run/dist && ln -s /run/dist /dist
          
          COPY start.sh /app/start.sh
          
          RUN chmod +x /app/start.sh
          
          ENTRYPOINT ["/app/start.sh"]
          
          CMD ["npm", "run", "start:dev"]
          

          start.sh:

          #!/bin/bash
          
          mkdir -p /run/app
          mkdir -p /run/php/sessions
          
          if [[ ! -f /app/data/.initialized ]]; then
            echo "Fresh installation, setting up data directory..."
            touch /app/data/.initialized
            echo "Done."
          fi
          
          chown -R node:node /app/data
          
          chown www-data:www-data /run/php/sessions
          
          exec "$@"
          

          Sorry, my comments are in French but it still doesn't work. I think I have misconfigured my docker.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Simon-Piquemal
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • BrutalBirdieB Offline
              BrutalBirdieB Offline
              BrutalBirdie
              Partner
              wrote on last edited by
              #6

              This is not really readable, please but your code in code brackets.
              ps: edit your post to avoid posting duplicates 😉


              What are code brackets, and how do I use them?

              ```
              CODE GOES HERE
              ```

              Like my work? Consider donating a drink. Cheers!

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Simon-Piquemal
                wrote on last edited by
                #7

                I've improved my message so it's more visible. in fact I have the impression that my folder link isn't working. because I still get this message: EROFS: read-only file system, rmdir '/dist'.
                In a Nestjs project, the typescript compiler code will go into this dist file and inside it there will be read, write and delete operations. This is inside my docker container. So my question is how to either fix this docker to transfer it to another folder that has these permissions or how to change the permissions. In fact I have the impression that the construction of the image works well but to start the docker and start to make operations in this folder it does not work because there are restrictions as it is written in the doc.

                1 Reply Last reply
                2
                • nebulonN Away
                  nebulonN Away
                  nebulon
                  Staff
                  wrote on last edited by
                  #8

                  I am not familiar with how nestjs works during startup, but something tries to wholesale rm the /dist folder. I guess it tries to rebuild the app on startup? You may have to copy the app from read-only to /run first thing in start.sh and then start the app and not symlink the folder? Just a guess though.

                  1 Reply Last reply
                  2
                  • J joseph moved this topic from Support 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