# Fablewright for Cloudron. # # Cloudron gives the app a read-only filesystem with one writable, backed-up # directory at /app/data. The database, the signing secret, and uploads all live # there, so the platform's backup covers the whole instance and a restore is one # operation. FROM cloudron/node-base:24-20261021@sha256:7435d8aca138ce01cfca4cd7ec05683223b8f5d7198c9abdaaefa1b6ba14b4c6 AS build WORKDIR /app/code # The commit this image was built from. A build context has no `.git` directory, # so the version and commit that the app reports come from here. ARG APP_COMMIT=unknown # pnpm is this project's package manager. Install the version the lockfile pins. RUN corepack enable && corepack prepare pnpm@12.21.0 --activate # pnpm links the agent skills a dependency ships into `.agents/skills` at # the project root, and the install fails when that directory is missing. # The skills are a tool for the person working on the code, so the image # creates the directory and ships none of them. RUN mkdir -p .agents/skills COPY . /app/code/ RUN pnpm install --frozen-lockfile \ && pnpm build \ && pnpm prune --prod FROM cloudron/node-base:24-20261021@sha256:7435d8aca138ce01cfca4cd7ec05683223b8f5d7198c9abdaaefa1b6ba14b4c6 RUN mkdir -p /app/code WORKDIR /app/code # Repeated from the build stage so the entry point can name the build in its log # and in the refusal message, before the app itself has loaded. ARG APP_COMMIT=unknown ENV APP_COMMIT=${APP_COMMIT} COPY --from=build /app/code/build ./build COPY --from=build /app/code/node_modules ./node_modules COPY --from=build /app/code/drizzle ./drizzle COPY --from=build /app/code/package.json ./package.json COPY --from=build /app/code/server.js ./server.js COPY --from=build /app/code/scripts ./scripts # The platform backup copies /app/data while the app is running. The two hooks # make the database in that copy consistent, and put it back on a restore. COPY cloudron/start.sh ./start.sh COPY cloudron/backup.sh ./cloudron-backup.sh COPY cloudron/restore.sh ./cloudron-restore.sh RUN chmod +x /app/code/start.sh /app/code/cloudron-backup.sh /app/code/cloudron-restore.sh CMD [ "/app/code/start.sh" ]