mirror of
https://git.srhtnin.garden/sarah/SaraView.git
synced 2026-10-13 18:28:14 +02:00
Server compose: match SpineS's real mounts
This commit is contained in:
1 parent
b896a81a64
commit
0d564982dc
2 files changed
+21
-42
No files matched your search
@@ -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 <volume name>:/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
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in new issue
Block a user