Files
KeepNote/docker-compose.yaml
T
Admin a791232f18 [feat](web): serve the SPA and web actions on the single listener
Add the browser edge (contract rev 8.2/9): a Preact/Vite SPA under web/,
an embedded placeholder bundle, the /web/* auth and action handlers, and
the explicit browser-action allowlist. The SPA and the API share the one
plaintext :8080 listener; there is no second port and no peer edge, so
main.go also drops the mTLS listener and the identity mounts in the debug
compose fall away. /_manifest announces the web block only while the SPA is
mounted (honesty rule), always with the single service port.

The DSNs move to the shared database's scram-sha-256 credentials, matching
rev 9's removal of the PKI layer.

Committed web/bun.lock because web/package.json and vite.config.ts are new
in this commit. src/web/dist/index.html is a hand-written placeholder, not
a generated bundle: it keeps bare `go build`/`go vet` working from a clean
checkout, while /web/dist (the real build output) stays gitignored.
2026-10-19 09:28:59 +01:00

51 lines
1.6 KiB
YAML

services:
keepnote-service:
extra_hosts:
- "host.docker.internal:host-gateway"
image: 192.168.122.183:3000/dcntrlized/keepnote:dev
container_name: keepnote
networks:
- dcntrlized_net
ports:
- "8081:8080"
- "9090:90"
# Contract rev 9 §3.4: ONE plaintext listener, published as 8081:8080. The
# browser web app (SPA + /web/*) rides the same port — there is no separate
# browser port. Opt-in in prod via DCNTRLIZED_WEB_ENABLED=true;
# web.Validate() then fails closed unless DCNTRLIZED_WEB_ORIGINS is
# non-empty and COOKIE_SECURE=true.
environment:
- DATABASE_URL=postgres://postgres:dcntrlized@dcntrlized-db:5432/dcntrlized?sslmode=disable
- AUTH_SERVICE_URL=http://dcntrlized-auth:8080
- DCNTRLIZED_WEB_ENABLED=${DCNTRLIZED_WEB_ENABLED:-false}
- DCNTRLIZED_WEB_ORIGINS=${DCNTRLIZED_WEB_ORIGINS:-}
- COOKIE_SECURE=${COOKIE_SECURE:-true}
depends_on:
- migrate
build:
context: .
dockerfile: Dockerfile
migrate:
image: postgres:16-alpine
container_name: keepnote-migrate
labels:
org.dcntrlized.oneoff: "true"
networks:
- dcntrlized_net
volumes:
- ./database/migrations:/migrations:ro
environment:
- PGHOST=dcntrlized-db
- PGPORT=5432
- PGUSER=postgres
- PGPASSWORD=dcntrlized
- PGDATABASE=dcntrlized
command: >
sh -c 'until pg_isready -h dcntrlized-db; do sleep 2; done;
for f in /migrations/*.sql; do [ -f "$$f" ] || continue; echo "Applying $$f"; psql -v ON_ERROR_STOP=1 -f "$$f" || exit 1; done'
networks:
dcntrlized_net:
external: true