From 8a3a36f0c2557aa7654564c80c144934fabc2625 Mon Sep 17 00:00:00 2001 From: chloe caruso Date: Wed, 9 Jul 2025 23:45:21 -0700 Subject: [PATCH] sot: fix deployment --- framework/backend/entry-node.ts | 2 +- readme.md | 3 +++ src/source-of-truth.dockerfile | 8 ++++---- src/source-of-truth.ts | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/framework/backend/entry-node.ts b/framework/backend/entry-node.ts index d934c84..4f4a249 100644 --- a/framework/backend/entry-node.ts +++ b/framework/backend/entry-node.ts @@ -6,7 +6,7 @@ const app = require(globalThis.CLOVER_SERVER_ENTRY ?? process.argv[2]); const protocol = "http"; const server = serve({ - fetch: app.fetch, + fetch: app.default.fetch, port: Number(process.env.PORT ?? 3000), }, ({ address, port }) => { if (address === "::") address = "::1"; diff --git a/readme.md b/readme.md index d3fc064..4edadb2 100644 --- a/readme.md +++ b/readme.md @@ -104,6 +104,9 @@ Deployment of the source of truth can be done with Docker Compose: - /mnt/storage1/clover/Documents/Config/paperclover:/data - /mnt/storage1/clover/Published:/published +Due to caching, one may need to manually purge images via +`docker image rm ix-paperclover-backend -f` when an update is desired + TODO: deployment instructions for a web node ## Contributions diff --git a/src/source-of-truth.dockerfile b/src/source-of-truth.dockerfile index 2c48f88..8c21c1e 100644 --- a/src/source-of-truth.dockerfile +++ b/src/source-of-truth.dockerfile @@ -1,6 +1,6 @@ -from node:24-alpine as builder +from node:24 as builder -run apk add --no-cache git +run apt install -y git workdir /paperclover.net copy package*.json ./ @@ -17,12 +17,12 @@ run npx esbuild --bundle \ --outdir=/app \ && cp framework/lib/mime.txt /app/ -from node:24-alpine as runtime +from node:24 as runtime workdir /app copy --from=builder /app/ ./ -env PORT=3001 +env PORT=43200 # must be configured env CLOVER_DB=/dev/null env CLOVER_FILE_RAW=/dev/null diff --git a/src/source-of-truth.ts b/src/source-of-truth.ts index 31bc688..8d3d59b 100644 --- a/src/source-of-truth.ts +++ b/src/source-of-truth.ts @@ -31,7 +31,7 @@ const nasRoot = process.platform === "win32" const rawFileRoot = process.env.CLOVER_FILE_RAW ?? path.join(nasRoot, "Published"); const derivedFileRoot = process.env.CLOVER_FILE_DERIVED ?? - path.join(nasRoot, "Documents/Config/clover_file/derived"); + path.join(nasRoot, "Documents/Config/paperclover/derived"); if (!fs.existsSync(rawFileRoot)) throw new Error(`${rawFileRoot} does not exist`); if (!fs.existsSync(derivedFileRoot)) throw new Error(`${derivedFileRoot} does not exist`);