feat: build from captions.coop/captions-deploy, translation models, relay auto-fill

- images/build.sh builds all three images from one pinned captions-deploy
  commit (submodules pin the captions.coop forks; web/Dockerfile is the UI).
- app: UI image configured by env (landing page, site-config.js), translation
  models downloaded into a volume on start (TRANSLATION_MODELS).
- stt: RELAY_AUTOFILL=source|all|off feeds the capture page's /relay-config.
- Drops the recipe's own nginx.conf and web Dockerfile.
This commit is contained in:
2026-10-13 14:49:42 -07:00
parent 4eec2598a8
commit 4fcdb2e225
8 changed files with 89 additions and 79 deletions
+23 -32
View File
@@ -1,46 +1,37 @@
#!/usr/bin/env bash
# Build the three caption-ninja images from pinned upstream commits.
# Build the three caption-ninja images from a pinned captions-deploy commit.
#
# Upstream publishes no images, so we build them ourselves. Run this on a
# Docker host (it needs no registry credentials); the images are tagged with
# their final registry names so a single-node swarm can deploy them directly.
# captions-deploy (git.coopcloud.tech/captions.coop/captions-deploy) pins the
# captions.coop forks of captionninja and caption-local as submodules and owns
# the UI image (web/Dockerfile). Nobody publishes images, so we build them here.
# Run this on a Docker host; it needs no registry credentials. Images are tagged
# with their final registry names so a single-node swarm can deploy them directly.
# See README.md "Images" for pushing them to the registry afterwards.
#
# usage: images/build.sh [workdir]
set -euo pipefail
REGISTRY=git.autonomic.zone/recipe-maintainers
CAPTIONNINJA_COMMIT=dfcee8f551a2b175740ab9f73e3787e1458cce2d
CAPTION_LOCAL_COMMIT=7d759fe1eae100ccdb5de0eea82438c941b26582
RELAY_VERSION=0.2.0 # captionninja relay/package.json
CAPTION_LOCAL_VERSION=1.1.0 # caption-local VERSION
WEB_VERSION=2026.09.07 # captionninja has no releases: date of CAPTIONNINJA_COMMIT
DEPLOY_REPO=https://git.coopcloud.tech/captions.coop/captions-deploy.git
DEPLOY_COMMIT=12fe0fade41ca65e1dda3704eb4fd9e204fde698
VERSION=2026.10.13 # date of DEPLOY_COMMIT; images share one semver-like tag
here="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
work="${1:-$(mktemp -d)}"
work="${1:-$(mktemp -d)}/captions-deploy"
tag="$VERSION-${DEPLOY_COMMIT:0:7}"
checkout() { # url commit dir
rm -rf "$3"
git init -q "$3"
git -C "$3" fetch -q --depth 1 "$1" "$2"
git -C "$3" checkout -q FETCH_HEAD
}
rm -rf "$work"
git init -q "$work"
git -C "$work" fetch -q --depth 1 "$DEPLOY_REPO" "$DEPLOY_COMMIT"
git -C "$work" checkout -q FETCH_HEAD
# Submodule URLs are SSH; fetch them anonymously over HTTPS instead.
git -C "$work" -c url."https://git.coopcloud.tech/".insteadOf="ssh://git@git.coopcloud.tech:2222/" \
submodule update -q --init --depth 1
git -C "$work" submodule status
checkout https://github.com/steveseguin/captionninja "$CAPTIONNINJA_COMMIT" "$work/captionninja"
checkout https://github.com/steveseguin/caption-local "$CAPTION_LOCAL_COMMIT" "$work/caption-local"
cn="${CAPTIONNINJA_COMMIT:0:7}"
cl="${CAPTION_LOCAL_COMMIT:0:7}"
docker build -t "$REGISTRY/caption-ninja-web:$WEB_VERSION-$cn" \
-f "$here/web/Dockerfile" "$work/captionninja"
docker build -t "$REGISTRY/caption-ninja-relay:$RELAY_VERSION-$cn" \
"$work/captionninja/relay"
docker build -t "$REGISTRY/caption-ninja-stt:$CAPTION_LOCAL_VERSION-$cl" \
"$work/caption-local"
docker build -t "$REGISTRY/caption-ninja-web:$tag" -f "$work/web/Dockerfile" "$work"
docker build -t "$REGISTRY/caption-ninja-relay:$tag" "$work/captionninja/relay"
docker build -t "$REGISTRY/caption-ninja-stt:$tag" "$work/caption-local"
echo
echo "Built:"
echo " $REGISTRY/caption-ninja-web:$WEB_VERSION-$cn"
echo " $REGISTRY/caption-ninja-relay:$RELAY_VERSION-$cn"
echo " $REGISTRY/caption-ninja-stt:$CAPTION_LOCAL_VERSION-$cl"
for image in web relay stt; do echo " $REGISTRY/caption-ninja-$image:$tag"; done
-7
View File
@@ -1,7 +0,0 @@
# Static caption.ninja pages. Build context: a captionninja checkout.
FROM alpine:3.22 AS src
COPY . /src
RUN cd /src && rm -rf .git .github relay scripts *.md test-security-warning.html
FROM nginx:1.31.6-alpine
COPY --from=src /src /usr/share/nginx/html