build: script to publish web/worker images to the Gitea registry
Adds scripts/build-push.sh (build + push lyra-web/lyra-worker :latest and :<sha> to git.jger.nl) + a README 'Deploying to a server (pre-built images)' section. The server pulls these via the vm-download ops repo (docker/lyra). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -102,6 +102,29 @@ reach the live DB automatically. Enter Qobuz / Soulseek / Last.fm credentials in
|
||||
**Settings** (they persist across rebuilds), then follow an artist or request an album
|
||||
to feed The Floor.
|
||||
|
||||
## Deploying to a server (pre-built images)
|
||||
|
||||
For a server that should **pull** rather than build, the `web` and `worker` images are
|
||||
published to the Gitea container registry and consumed by a compose file in the
|
||||
[`vm-download`](https://git.jger.nl/Jonathan/vm-download) ops repo (`docker/lyra/`).
|
||||
|
||||
Publish a new release from this repo (amd64):
|
||||
|
||||
```sh
|
||||
docker login git.jger.nl # once — Gitea user + a token with package:write
|
||||
./scripts/build-push.sh # builds + pushes lyra-web / lyra-worker (:latest and :<sha>)
|
||||
```
|
||||
|
||||
Then on the server:
|
||||
|
||||
```sh
|
||||
cd /opt/git/vm-download && git pull
|
||||
cd docker/lyra && docker compose pull && docker compose up -d
|
||||
```
|
||||
|
||||
`db` (Postgres) and `db-backup` use the stock `postgres:17` image, so only the two custom
|
||||
images are built here. See `docker/lyra/README.md` in the ops repo for first-time setup.
|
||||
|
||||
## Managing the library
|
||||
|
||||
Open an album on the **Library** page and use **Delete album** to remove it: the folder is
|
||||
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build the Lyra web + worker images and push them to the Gitea container registry, so the VM
|
||||
# can pull pre-built images instead of building from source.
|
||||
#
|
||||
# Usage (from the Lyra repo root):
|
||||
# docker login git.jger.nl # once — Gitea username + a token with package:write
|
||||
# ./scripts/build-push.sh # builds + pushes :latest and :<short-sha>
|
||||
#
|
||||
# Override the registry namespace with LYRA_REGISTRY (default git.jger.nl/jonathan).
|
||||
set -euo pipefail
|
||||
|
||||
REGISTRY="${LYRA_REGISTRY:-git.jger.nl/jonathan}"
|
||||
here="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
sha="$(git -C "$here" rev-parse --short HEAD)"
|
||||
|
||||
for svc in web worker; do
|
||||
img="$REGISTRY/lyra-$svc"
|
||||
echo "==> building $img ($sha)"
|
||||
docker build -t "$img:latest" -t "$img:$sha" "$here/$svc"
|
||||
done
|
||||
|
||||
for svc in web worker; do
|
||||
img="$REGISTRY/lyra-$svc"
|
||||
echo "==> pushing $img:latest and $img:$sha"
|
||||
docker push "$img:latest"
|
||||
docker push "$img:$sha"
|
||||
done
|
||||
|
||||
echo "Done. Pulled on the VM with: docker compose pull && docker compose up -d"
|
||||
Reference in New Issue
Block a user