diff --git a/readme.md b/readme.md index da47830..d3fc064 100644 --- a/readme.md +++ b/readme.md @@ -73,6 +73,39 @@ my development machine, for example, is Dell Inspiron 7348 with Core i7 for unix systems, the provided `flake.nix` can be used with `nix develop` to open a shell with all needed system dependencies. +## Deployment + +There are two primary server components to be deployed: the web server and the +sourth of truth server. The latter is a singleton that runs on Clover's NAS, +which holds the full contents of the file storage. The web server pulls data +from the source of truth and renders web pages, and can be duplicated to +multiple cloud hosts without issue. + +Deployment of the source of truth can be done with Docker Compose: + + services: + backend: + container_name: backend + build: + # this uses loopback to hit the self-hosted git server + context: http://localhost:3000/clo/sitegen.git + dockerfile: src/source-of-truth.dockerfile + environment: + # configuration + - PORT=43200 + - CLOVER_DB=/data + - CLOVER_FILE_RAW=/published + - CLOVER_FILE_DERIVED=/data/derived + - CLOVER_SOT_KEY=... # guards private/unreleased content + ports: + - '43200:43200' + restart: unless-stopped + volumes: + - /mnt/storage1/clover/Documents/Config/paperclover:/data + - /mnt/storage1/clover/Published:/published + +TODO: deployment instructions for a web node + ## Contributions No contributions to `src` accepted, only `framework`. diff --git a/src/source-of-truth.dockerfile b/src/source-of-truth.dockerfile index 3bdf435..2c48f88 100644 --- a/src/source-of-truth.dockerfile +++ b/src/source-of-truth.dockerfile @@ -14,7 +14,8 @@ run npx esbuild --bundle \ --minify \ --sourcemap=linked \ --entry-names=index \ - --outdir=/app + --outdir=/app \ + && cp framework/lib/mime.txt /app/ from node:24-alpine as runtime