From 0d564982dc106947a82366c17f02acd5f33dfd3b Mon Sep 17 00:00:00 2001 From: SRHTNIN Date: Thu, 24 Sep 2026 22:10:18 +0200 Subject: [PATCH] Server compose: match SpineS's real mounts --- README.md | 47 ++++++++++++--------------------------- docker-compose.server.yml | 16 ++++++------- 2 files changed, 21 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 2c25303..cfcfce1 100644 --- a/README.md +++ b/README.md @@ -197,47 +197,28 @@ repo**. Portainer clones the repo, builds the image from the `Dockerfile` and starts it, using `docker-compose.server.yml`. There's no image registry and no CI: pushing a commit is all a release takes. -The stack keeps SaraView's config and data in a plain directory on the -server (`/DATA/AppData/SaraView` by default), not in a Docker volume, so -redeploying or removing the stack never touches it. +Config and data live in plain directories on the server (by default +`/media/ZimaOS-HD/AppData/SaraView`, holding `SaraViewConf.toml` and +`Data/`), not in a Docker volume, so redeploying or removing the stack never +touches them. The files SaraView serves are mounted at `/data/files` +(default `/media/ZimaOS-HD/Storage/Files`); the Roots in the server's +`SaraViewConf.toml` point inside it. -### First-time setup +### Setting up the stack -1. On the server, create the directory and put the config in it: - ```bash - mkdir -p /DATA/AppData/SaraView/Data - cp SaraViewConf.toml /DATA/AppData/SaraView/ - ``` - The config has to exist before the first deploy: Docker would otherwise - create a *directory* named `SaraViewConf.toml` in its place. +1. `SaraViewConf.toml` has to exist in the config directory before the first + deploy: Docker would otherwise create a *directory* with that name. 2. In Portainer: **Stacks** → **Add stack** → **Repository**, on the SpineS environment. - - Repository URL: this repo on Gitea. For a private repo, turn on - **Authentication** with your Gitea username and an access token. + - Repository URL: this repo on Gitea (`http://git.srhtnin.garden/sarah/SaraView`) - Repository reference: `refs/heads/main` - Compose path: `docker-compose.server.yml` - - Environment variables: `NotesDir` and `SaraTagDir` (required), and - `SaraViewDir` if the data shouldn't live in `/DATA/AppData/SaraView`. + - Environment variables: none needed on SpineS. Set `SaraViewDir` and/or + `FilesDir` to use other directories. - **GitOps updates** on, with polling (e.g. every 5 minutes), so new commits on `main` redeploy on their own. -3. **Deploy the stack.** The first build takes a few minutes (it builds the - frontend and installs the backend). - -### Moving over from the old ZimaOS app - -The old install (the ZimaOS "customized app" pulling from GHCR) kept its -data in a Docker named volume. Copy it to the new directory once: - -```bash -docker volume ls | grep -i saraview # find the volume's name -docker run --rm -v :/From -v /DATA/AppData/SaraView/Data:/To \ - alpine sh -c "cp -a /From/. /To/" -``` - -Then stop the old app in ZimaOS and remove its container -(`docker rm SaraView`; the volume stays) before deploying the stack, since -both use the container name `SaraView` and port 8420. Once the new stack is -confirmed working, the old app and its volume can be removed. +3. Stop anything else using port 8420 (e.g. an older SaraView install), then + **Deploy the stack**. The first build takes a few minutes. ### Updating diff --git a/docker-compose.server.yml b/docker-compose.server.yml index 4a18388..80ad8e3 100644 --- a/docker-compose.server.yml +++ b/docker-compose.server.yml @@ -5,11 +5,10 @@ # # Paths are absolute host paths on the server: Portainer's copy of the repo # lives inside Portainer (on RibS), so "./something" wouldn't point at SpineS. -# Set these as stack environment variables in Portainer: -# NotesDir the notes directory to serve (required) -# SaraTagDir SaraTag's .saratag directory (required) -# SaraViewDir where SaraView's config and data live -# (default /DATA/AppData/SaraView, the ZimaOS convention) +# The defaults are SpineS's; override them as stack environment variables: +# SaraViewDir SaraView's config (SaraViewConf.toml) and Data directory +# FilesDir the files SaraView serves, mounted at /data/files +# (the Roots in SaraViewConf.toml point inside it) services: saraview: build: . @@ -21,8 +20,7 @@ services: ports: - "8420:8420" volumes: - - ${SaraViewDir:-/DATA/AppData/SaraView}/SaraViewConf.toml:/App/Backend/SaraViewConf.toml:ro - - ${SaraViewDir:-/DATA/AppData/SaraView}/Data:/data/SaraViewData - - ${NotesDir:?Set NotesDir to the notes directory on the server}:/data/notes:ro - - ${SaraTagDir:?Set SaraTagDir to the .saratag directory on the server}:/data/SaraTag/.saratag:ro + - ${SaraViewDir:-/media/ZimaOS-HD/AppData/SaraView}/SaraViewConf.toml:/App/Backend/SaraViewConf.toml:ro + - ${SaraViewDir:-/media/ZimaOS-HD/AppData/SaraView}/Data:/data/SaraViewData + - ${FilesDir:-/media/ZimaOS-HD/Storage/Files}:/data/files restart: unless-stopped