Something went wrong. Try again.
A free, open-source, self-hosted place to write a novel.
Something went wrong. Try again.
Fablewright Dockerfile.cloudron
2.2 kB · 56 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657# 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/codeWORKDIR /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=unknownENV APP_COMMIT=${APP_COMMIT}
COPY --from=build /app/code/build ./buildCOPY --from=build /app/code/node_modules ./node_modulesCOPY --from=build /app/code/drizzle ./drizzleCOPY --from=build /app/code/package.json ./package.jsonCOPY --from=build /app/code/server.js ./server.jsCOPY --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.shCOPY cloudron/backup.sh ./cloudron-backup.shCOPY 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" ]