homelab-codex-ws/kb/runbooks/narty27-deploy.md

53 lines
1.8 KiB
Markdown
Raw Normal View History

---
okf: "0.1"
type: runbook
visibility: private
status: active
updated: 2026-07-31
links:
- ../services/narty27.md
---
# narty27 — uruchomienie i operacje
## Updating the content (from SOLARIA)
```bash
# 1. Ship the file to PIHA
scp ~/narty-2027/saalbach-kb/viz.html piha:/tmp/viz.html
# 2. Write BOTH copies into the volume via a throwaway helper container
ssh piha 'docker run --rm \
-v narty27_narty27_content:/content \
-v /tmp:/src:ro \
alpine sh -c "cp /src/viz.html /content/viz.html && cp /src/viz.html /content/index.html"'
# 3. Drop the staging copy
ssh piha 'rm -f /tmp/viz.html'
# 4. Verify (no container restart needed — nginx serves from disk per request)
curl -sf -o /dev/null -w '%{http_code}\n' http://192.168.31.5:8240/viz.html
curl -sf -o /dev/null -w '%{http_code}\n' http://192.168.31.5:8240/
```
**Why a helper container and not `docker cp`:** the volume is mounted `:ro` into
the nginx container, and `docker cp` writes through the container's mount
namespace — it fails with `mounted volume is marked read-only`, for both running
and stopped containers (verified 2026-07-31). The helper container mounts the
same volume read-write and bypasses nginx entirely.
## First start
`nginx:alpine` seeds an empty named volume with its own default `index.html` and
`50x.html` on first run, so the root will show the nginx welcome page until step
2 above overwrites `index.html`. Until then `/viz.html` 404s and the container
healthcheck reports unhealthy — this is expected, not a failure.
## Operations
```bash
docker compose -f services/narty27/docker-compose.yml up -d # on PIHA
./healthcheck.sh # container + both paths
docker volume ls | grep narty27 # narty27_narty27_content
```