Sign inSign up

20dumpling/ea-qms-frontend

By 20dumpling

•Updated 11 days ago

Image
0

87

20dumpling/ea-qms-frontend repository overview

⁠EA QMS — Change Control Frontend

The web client for the Change Control module of a Quality Management System. Change records move through a six-state workflow with two approval gates, every decision is captured by an electronic signature, and what a user may edit depends on both their role and the record's current state.

Built with Svelte 5 and SvelteKit as a single-page application; served here by Caddy.

⁠What this image is

Caddy, with the built application copied in. It is both the web server and a reverse proxy: it serves the static files, and it forwards everything under /api/ to the API.

It cannot work alone. There is no API and no database inside it. It needs something reachable at API_UPSTREAM, which defaults to api:1304 — a default that suits any Docker network whose API service is named api.

The container starts whether or not the API is there, because Caddy resolves the upstream per request rather than at boot. A missing API shows up as a 502 on the first call, not as a container that fails to start.

⁠Tags

TagPlatforms
1.0.0, latestlinux/amd64, linux/arm64 under one tag — docker pull resolves the right variant

⁠Run it

Against an API running on your host:

docker run -d --rm -p 8080:80 \
  -e API_UPSTREAM=host.docker.internal:1304 \
  20dumpling/ea-qms-frontend:1.0.0

Against the API's own Compose stack, joined to its network:

docker run -d --rm -p 8080:80 --network docker_default \
  20dumpling/ea-qms-frontend:1.0.0

Then open http://localhost:8080⁠.

⁠Configuration

Variable
API_UPSTREAMHost and port of the API. Default api:1304. Read when Caddy starts, so changing it needs a restart, not a reload

That is the only runtime variable.

⚠ The API's URL is baked in at build time, as the relative path /api, which is what puts the app and the API on one origin. It is not runtime-configurable — serving the API from somewhere other than /api on the same origin means rebuilding the image with --build-arg PUBLIC_API_URL=…. Under normal use you want the default, and you want API_UPSTREAM instead.

⁠Notes for deploying it

  • Serve it from the origin root. Every internal link is root-absolute, so mounting it under a sub-path such as /qms/ serves a blank page. That is a rebuild, not a proxy setting.
  • Put TLS in front of it. The container speaks plain HTTP on port 80, and the session's refresh token lives in the browser's localStorage.
  • Set the API's ALLOWED_ORIGINS to the origin the browser uses, e.g. http://localhost:8080. CORS no longer applies once the proxy puts both on one origin, but the API logs a warning for every unrecognised Origin it sees, and browsers send one on every POST and PUT regardless.
  • Health: the image reports healthy when Caddy is serving the document. It deliberately does not probe the API, so a backend blip cannot mark this container unhealthy.

⁠Test accounts

Seeded by the API image. All four share the password DevPassw0rd!: [email protected], [email protected], [email protected], [email protected].

Tag summary

Content type

Image

Digest

sha256:6f1c318a9…

Size

23.2 MB

Last updated

11 days ago

docker pull 20dumpling/ea-qms-frontend