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 starts it, using `docker-compose.server.yml`. There's no image registry
|
||||||
and no CI: pushing a commit is all a release takes.
|
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
|
Config and data live in plain directories on the server (by default
|
||||||
server (`/DATA/AppData/SaraView` by default), not in a Docker volume, so
|
`/media/ZimaOS-HD/AppData/SaraView`, holding `SaraViewConf.toml` and
|
||||||
redeploying or removing the stack never touches it.
|
`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:
|
1. `SaraViewConf.toml` has to exist in the config directory before the first
|
||||||
```bash
|
deploy: Docker would otherwise create a *directory* with that name.
|
||||||
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.
|
|
||||||
2. In Portainer: **Stacks** → **Add stack** → **Repository**, on the
|
2. In Portainer: **Stacks** → **Add stack** → **Repository**, on the
|
||||||
SpineS environment.
|
SpineS environment.
|
||||||
- Repository URL: this repo on Gitea. For a private repo, turn on
|
- Repository URL: this repo on Gitea (`http://git.srhtnin.garden/sarah/SaraView`)
|
||||||
**Authentication** with your Gitea username and an access token.
|
|
||||||
- Repository reference: `refs/heads/main`
|
- Repository reference: `refs/heads/main`
|
||||||
- Compose path: `docker-compose.server.yml`
|
- Compose path: `docker-compose.server.yml`
|
||||||
- Environment variables: `NotesDir` and `SaraTagDir` (required), and
|
- Environment variables: none needed on SpineS. Set `SaraViewDir` and/or
|
||||||
`SaraViewDir` if the data shouldn't live in `/DATA/AppData/SaraView`.
|
`FilesDir` to use other directories.
|
||||||
- **GitOps updates** on, with polling (e.g. every 5 minutes), so new
|
- **GitOps updates** on, with polling (e.g. every 5 minutes), so new
|
||||||
commits on `main` redeploy on their own.
|
commits on `main` redeploy on their own.
|
||||||
3. **Deploy the stack.** The first build takes a few minutes (it builds the
|
3. Stop anything else using port 8420 (e.g. an older SaraView install), then
|
||||||
frontend and installs the backend).
|
**Deploy the stack**. The first build takes a few minutes.
|
||||||
|
|
||||||
### 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.
|
|
||||||
|
|
||||||
### Updating
|
### Updating
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,10 @@
|
|||||||
#
|
#
|
||||||
# Paths are absolute host paths on the server: Portainer's copy of the repo
|
# 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.
|
# lives inside Portainer (on RibS), so "./something" wouldn't point at SpineS.
|
||||||
# Set these as stack environment variables in Portainer:
|
# The defaults are SpineS's; override them as stack environment variables:
|
||||||
# NotesDir the notes directory to serve (required)
|
# SaraViewDir SaraView's config (SaraViewConf.toml) and Data directory
|
||||||
# SaraTagDir SaraTag's .saratag directory (required)
|
# FilesDir the files SaraView serves, mounted at /data/files
|
||||||
# SaraViewDir where SaraView's config and data live
|
# (the Roots in SaraViewConf.toml point inside it)
|
||||||
# (default /DATA/AppData/SaraView, the ZimaOS convention)
|
|
||||||
services:
|
services:
|
||||||
saraview:
|
saraview:
|
||||||
build: .
|
build: .
|
||||||
@@ -21,8 +20,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "8420:8420"
|
- "8420:8420"
|
||||||
volumes:
|
volumes:
|
||||||
- ${SaraViewDir:-/DATA/AppData/SaraView}/SaraViewConf.toml:/App/Backend/SaraViewConf.toml:ro
|
- ${SaraViewDir:-/media/ZimaOS-HD/AppData/SaraView}/SaraViewConf.toml:/App/Backend/SaraViewConf.toml:ro
|
||||||
- ${SaraViewDir:-/DATA/AppData/SaraView}/Data:/data/SaraViewData
|
- ${SaraViewDir:-/media/ZimaOS-HD/AppData/SaraView}/Data:/data/SaraViewData
|
||||||
- ${NotesDir:?Set NotesDir to the notes directory on the server}:/data/notes:ro
|
- ${FilesDir:-/media/ZimaOS-HD/Storage/Files}:/data/files
|
||||||
- ${SaraTagDir:?Set SaraTagDir to the .saratag directory on the server}:/data/SaraTag/.saratag:ro
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
Reference in new issue
Block a user