Add V2 Forgejo workflow publishing study:v2 image

Pushes to v2 typecheck and test inside the Node 24 image via a new Dockerfile
test stage, build and smoke-test the production image as a fresh non-root
container, then publish :v2 and :v2-<sha>. Never touches V1's :latest.
Document the image tags and Unraid 99:100 volume ownership.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-11-12 11:29:22 -07:00
parent d7e19db468
commit 3046e46d1c
4 changed files with 107 additions and 10 deletions

View file

@ -2,8 +2,25 @@
## Unraid
Build from this checkout with `docker build -t study-desk:v2-local .`.
Create a **new** container named `study-v2`, image `study-desk:v2-local`:
### Getting the image
Every push to the `v2` branch runs `.forgejo/workflows/build-v2.yml`. It typechecks and runs the
test suite inside the Node 24 image (`docker build --target test`), builds the production image,
smoke-tests it as a fresh non-root container, then publishes two tags:
- `git.elijahkuntz.com/elijah/study:v2` (moves with each successful `v2` push)
- `git.elijahkuntz.com/elijah/study:v2-<12-char commit>` (fixed; use it to pin or roll back)
It **never** publishes `:latest`, which V1's `main` workflow owns. Keep the V1 container on its
existing tag. Do not merge `v2` into `main` until V2 replaces V1: that merge would remove V1's
workflow, and this one only triggers on `v2`. The workflow can also be run manually.
Alternatively build locally from this checkout with `docker build -t study-desk:v2-local .`.
### Container settings
Create a **new** container named `study-v2`, image `git.elijahkuntz.com/elijah/study:v2`
(or your local tag):
| Setting | Value |
| --- | --- |
@ -16,11 +33,15 @@ Create a **new** container named `study-v2`, image `study-desk:v2-local`:
| TRUST_PROXY | true only behind a trusted proxy |
| COOKIE_SECURE | true with HTTPS; auto for local HTTP testing |
The image uses UID/GID **1000:1000**. Create a dedicated host directory writable by that user
before starting. For example, on Unraid: `mkdir -p /mnt/user/appdata/study-v2` then
`chown 1000:1000 /mnt/user/appdata/study-v2`. Only change permissions on this new folder.
Alternatively select an appropriate non-root UID/GID using Docker's `--user` option and grant
that identity access to the dedicated directory. Never mount V1's database or data folder.
The image uses UID/GID **1000:1000**. Unraid appdata folders are normally owned by
`nobody:users` (**99:100**), which that user cannot write to. Pick one:
- Create the dedicated folder and hand it to 1000: `mkdir -p /mnt/user/appdata/study-v2` then
`chown 1000:1000 /mnt/user/appdata/study-v2`. Only change permissions on this new folder.
- Or keep Unraid's ownership and add `--user 99:100` to the container's Extra Parameters.
If the container restarts repeatedly with a permissions error in its log, this is the cause.
Never mount V1's database or data folder.
The supplied `compose.yaml` defaults to `./data-v2` and host port 3727. Override
`STUDY_DATA_DIR` for Unraid. Do not reuse a V1 container name, mount or proxy destination.