Skip to content

chore(docker): compose deployment with healthcheck, auth, and resilient WS proxy#26

Merged
libersoft-org merged 18 commits into
mainfrom
prepare/docker-compose-backend
May 28, 2026
Merged

chore(docker): compose deployment with healthcheck, auth, and resilient WS proxy#26
libersoft-org merged 18 commits into
mainfrom
prepare/docker-compose-backend

Conversation

@lukyrys
Copy link
Copy Markdown
Collaborator

@lukyrys lukyrys commented May 4, 2026

Summary

Brings up LiberShare under docker compose with a hardened backend + HTTPS
frontend, then layers operational concerns on top:

  • two-service stack (backend, frontend) sharing an internal Docker network
  • configurable bind mounts for config / storage / certs + first-run perms doc
  • backend host port bound to 127.0.0.1 by default (BACKEND_BIND to expose)
  • optional shared-secret authentication via LISH_TOKEN env (forwarded by the FE proxy on every WS upgrade)
  • /health liveness endpoint + --healthcheck self-flag + compose service_healthy gate
  • self-signed TLS generation, same-origin /ws proxy with reconnect/backoff
  • fail-fast on unwritable data directory (EACCES/EROFS/EPERM/ENOSPC/EISDIR) with operator-actionable hint
  • frontend API URL helper + local Vite /ws proxy for dev
  • 26 new unit tests (storage classifier, /health probe, healthcheck port resolver) — bun test clean

Verification

  • BE bun test tests/unit/ → 431 pass / 0 fail
  • FE bun test tests/ → 10 pass / 0 fail
  • BE bun run typecheck → clean
  • FE bun run check → 0 errors / 0 warnings
  • Docker build on a debian host: backend (single binary, embedded worker) + frontend images build clean
  • docker compose up -d → both containers healthy, FE waits for BE service_healthy
  • /health, /status (with and without LISH_TOKEN), --healthcheck exit codes all verified live
  • Backend restart mid-session keeps the browser WebSocket alive — proxy reconnects upstream with exponential backoff and replays buffered messages

@lukyrys lukyrys force-pushed the prepare/docker-compose-backend branch from df88c3c to ad4f355 Compare May 9, 2026 10:52
@lukyrys lukyrys changed the title chore(docker): add compose deployment chore(docker): compose deployment with healthcheck, auth, and resilient WS proxy May 9, 2026
@lukyrys lukyrys marked this pull request as ready for review May 11, 2026 07:35
Adds tests/bun-types.d.ts with a triple-slash reference to @types/bun so
svelte-check / tsc can resolve the bun:test virtual module without having
to exclude every tests/**/*.test.ts file from the strict frontend tsconfig.

- tsconfig: drop the catch-all tests exclude so test sources are type-checked
  against the same strict flags as production code
- tests/bun-types.d.ts: single-line ambient ref pulls in @types/bun
- tests/unit/language.test.ts: drop the @ts-expect-error workaround on the
  bun:test import that's no longer unresolved
@libersoft-org libersoft-org merged commit b9ab4d2 into main May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants