feat(kb-site): serwis nginx na PIHA + manifesty (wzorzec narty27)
services/kb-site/ — nginx:alpine serwujacy wolumen kb-site_content
(:ro, /usr/share/nginx/html), pelny layout z CLAUDE.md: docker-compose.yml,
service.yaml, README-wskaznik, env.example (swiadomie pusty — brak sekretow),
healthcheck.sh. Wpis w hosts/piha/services.yaml.
Port hosta 8250, NIE 8240 z opisu zadania: 8240 jest juz zajete przez narty27
(services/narty27/docker-compose.yml). Blok statyczny PIHA to 8210 paperless,
8220 nextcloud, 8230 kb-query, 8240 narty27 -> 8250 to nastepny wolny.
Uzgodnione z operatorem.
exposure: public — w odroznieniu od narty27 ta wystawka ma byc dostepna z
internetu przez vhost npm@PIHA kb.okit.pl; bind :8250 jest upstreamem proxy,
nie punktem wejscia.
Tresc jest czystym artefaktem repo (wyjscie scripts/kb/gen_pages.py), zyje
wylacznie w wolumenie kb-site_kb-site_content — bez binda pod /opt/homelab/data
i bez zadania backupu: odtworzeniem jest regeneracja z kb/.
Sprawdzone lokalnie: docker compose config -q, bash -n healthcheck.sh,
yaml.safe_load na obu manifestach.
2026-08-04 17:59:05 +02:00
|
|
|
services:
|
|
|
|
|
kb-site:
|
|
|
|
|
image: nginx:alpine
|
|
|
|
|
container_name: kb-site
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
ports:
|
|
|
|
|
# PIHA 82x0 static-HTTP block: 8210 paperless, 8220 nextcloud,
|
|
|
|
|
# 8230 kb-query, 8240 narty27 -> 8250 is the next free slot.
|
|
|
|
|
# Publicly the site is reached only through the npm@PIHA vhost
|
|
|
|
|
# kb.okit.pl; this bind is the proxy's upstream.
|
|
|
|
|
- "8250:80"
|
|
|
|
|
volumes:
|
|
|
|
|
# Generated output of scripts/kb/gen_pages.py — never committed, never
|
|
|
|
|
# bind-mounted from the repo. Read-only: nginx only serves it; writes go
|
|
|
|
|
# through the helper-container procedure in kb/runbooks/kb-site-deploy.md
|
|
|
|
|
# (docker cp cannot write into a :ro mount).
|
|
|
|
|
- kb-site_content:/usr/share/nginx/html:ro
|
2026-08-05 11:58:00 +02:00
|
|
|
# robots.txt nie pochodzi z generatora — nie jest dokumentem KB, więc
|
|
|
|
|
# jedzie z repo i nie ginie przy podmianie zawartości wolumenu. Mount
|
|
|
|
|
# pliku jest głębszy niż mount katalogu, więc Docker montuje go później
|
|
|
|
|
# i plik przykrywa (nieistniejące) robots.txt z wolumenu.
|
|
|
|
|
- ./static/robots.txt:/usr/share/nginx/html/robots.txt:ro
|
2026-08-04 21:28:43 +02:00
|
|
|
# Docker on PIHA has exhausted its default address pools (~30 live stacks:
|
|
|
|
|
# "all predefined address pools have been fully subnetted"), so this stack
|
|
|
|
|
# must not ask for a subnet of its own. Declaring a network here suppresses
|
|
|
|
|
# the implicit kb-site_default; we join the pre-existing shared "proxy"
|
|
|
|
|
# bridge instead. This is only about subnet economy — npm@PIHA still reaches
|
|
|
|
|
# this container over the published 8250 host port (npm itself lives on
|
|
|
|
|
# nginxproxymanager_default), not over this network.
|
|
|
|
|
networks:
|
|
|
|
|
- proxy
|
feat(kb-site): serwis nginx na PIHA + manifesty (wzorzec narty27)
services/kb-site/ — nginx:alpine serwujacy wolumen kb-site_content
(:ro, /usr/share/nginx/html), pelny layout z CLAUDE.md: docker-compose.yml,
service.yaml, README-wskaznik, env.example (swiadomie pusty — brak sekretow),
healthcheck.sh. Wpis w hosts/piha/services.yaml.
Port hosta 8250, NIE 8240 z opisu zadania: 8240 jest juz zajete przez narty27
(services/narty27/docker-compose.yml). Blok statyczny PIHA to 8210 paperless,
8220 nextcloud, 8230 kb-query, 8240 narty27 -> 8250 to nastepny wolny.
Uzgodnione z operatorem.
exposure: public — w odroznieniu od narty27 ta wystawka ma byc dostepna z
internetu przez vhost npm@PIHA kb.okit.pl; bind :8250 jest upstreamem proxy,
nie punktem wejscia.
Tresc jest czystym artefaktem repo (wyjscie scripts/kb/gen_pages.py), zyje
wylacznie w wolumenie kb-site_kb-site_content — bez binda pod /opt/homelab/data
i bez zadania backupu: odtworzeniem jest regeneracja z kb/.
Sprawdzone lokalnie: docker compose config -q, bash -n healthcheck.sh,
yaml.safe_load na obu manifestach.
2026-08-04 17:59:05 +02:00
|
|
|
# busybox wget — nginx:alpine ships no curl. index.html is generated on
|
|
|
|
|
# every run, so it is the one file that must always be there.
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1/index.html"]
|
|
|
|
|
interval: 30s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
retries: 5
|
|
|
|
|
start_period: 5s
|
|
|
|
|
|
2026-08-04 21:28:43 +02:00
|
|
|
networks:
|
|
|
|
|
# Created out-of-band on PIHA (docker network create proxy); never managed by
|
|
|
|
|
# this stack. `docker network ls | grep -w proxy` must return a row before
|
|
|
|
|
# deploy, otherwise compose fails with "network proxy declared as external,
|
|
|
|
|
# but could not be found".
|
|
|
|
|
proxy:
|
|
|
|
|
external: true
|
|
|
|
|
|
feat(kb-site): serwis nginx na PIHA + manifesty (wzorzec narty27)
services/kb-site/ — nginx:alpine serwujacy wolumen kb-site_content
(:ro, /usr/share/nginx/html), pelny layout z CLAUDE.md: docker-compose.yml,
service.yaml, README-wskaznik, env.example (swiadomie pusty — brak sekretow),
healthcheck.sh. Wpis w hosts/piha/services.yaml.
Port hosta 8250, NIE 8240 z opisu zadania: 8240 jest juz zajete przez narty27
(services/narty27/docker-compose.yml). Blok statyczny PIHA to 8210 paperless,
8220 nextcloud, 8230 kb-query, 8240 narty27 -> 8250 to nastepny wolny.
Uzgodnione z operatorem.
exposure: public — w odroznieniu od narty27 ta wystawka ma byc dostepna z
internetu przez vhost npm@PIHA kb.okit.pl; bind :8250 jest upstreamem proxy,
nie punktem wejscia.
Tresc jest czystym artefaktem repo (wyjscie scripts/kb/gen_pages.py), zyje
wylacznie w wolumenie kb-site_kb-site_content — bez binda pod /opt/homelab/data
i bez zadania backupu: odtworzeniem jest regeneracja z kb/.
Sprawdzone lokalnie: docker compose config -q, bash -n healthcheck.sh,
yaml.safe_load na obu manifestach.
2026-08-04 17:59:05 +02:00
|
|
|
volumes:
|
|
|
|
|
kb-site_content:
|