Skip to content

feat(web): publish a glabs-web container image#128

Merged
obcode merged 1 commit into
mainfrom
feat/web-docker-image
Jul 20, 2026
Merged

feat(web): publish a glabs-web container image#128
obcode merged 1 commit into
mainfrom
feat/web-docker-image

Conversation

@obcode

@obcode obcode commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Erster Milestone-F-PR (Deploy): das Container-Image für glabs-web. Der Deploy-Stack (deploy/Caddyfile + docker-compose.yml) folgt als zweiter PR und referenziert dieses Image.

Was drin ist

  • Dockerfile — multi-stage. Baut nur ./cmd/glabs-web (das Repo liefert zwei Binaries aus einem Modul) als statisches CGO-off-Binary auf schlankem alpine, mit ca-certificates (TLS zu GitLab/ZPA/SMTP) + tzdata (main() setzt time.Local=Europe/Berlin), non-root (uid 10001). Mail-Templates sind via //go:embed im Binary — kein Asset-Copy nötig.
  • .dockerignore — hält den Build-Context schlank und schließt .glabs-web.yaml aus, damit Secrets nie in ein Image geraten. Deaktiviert bewusst den .git-VCS-Fallback → Version kommt als build-arg.
  • .github/workflows/docker.yml — baut/pusht ghcr.io/obcode/glabs-web bei Release (workflow_dispatch(tag) + release: published), Tags <tag> + latest, reicht VERSION per build-arg (ldflags → main.version).
  • ci.yml — der Release-Job dispatcht docker.yml selbst, wenn go-semantic-release einen neuen Tag erzeugt hat (GITHUB_TOKEN-Release feuert kein release-Event). Vorher/Nachher-Tag-Diff, actions: write. Analog zur glabs.gui-Pipeline ([[glabs-gui-repo]]).

Verifikation (lokal, e2e)

  • docker build grün.
  • Container läuft non-root (uid 10001), tzdata/Europe/Berlin vorhanden, sauberer Fehler ohne Config.
  • Voller Smoke: Container gegen Wegwerf-Mongo → GraphQL antwortet: serverInfo.version = v0.0.0-test (beweist die ldflags-build-arg-Injektion), me.email = local@localhost (Dev-User), Job-Runner startet.
  • Beide Workflows: actionlint grün.

Der PR-Titel ist feat, damit ein Release ausgelöst und direkt das erste Image gebaut wird.

🤖 Generated with Claude Code

Add a multi-stage Dockerfile that builds only ./cmd/glabs-web (the repo
ships two binaries from one module) into a static CGO-off binary on a
minimal alpine runtime with ca-certificates + tzdata (main() sets
time.Local to Europe/Berlin) and a non-root user. A .dockerignore keeps
the build context lean and, notably, excludes .glabs-web.yaml so secrets
never enter an image.

docker.yml builds and pushes ghcr.io/obcode/glabs-web on a release. Since
go-semantic-release authors the release with GITHUB_TOKEN (which does not
fire the `release` event), ci.yml's release job dispatches docker.yml
itself when a new tag was created — mirroring the glabs.gui pipeline.

This is the first Milestone-F PR; the deploy/ stack (Caddyfile +
docker-compose.yml) follows and references this image.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@obcode
obcode merged commit d54460f into main Jul 20, 2026
8 checks passed
@obcode
obcode deleted the feat/web-docker-image branch July 20, 2026 10:59
obcode added a commit that referenced this pull request Jul 20, 2026
…o) (#129)

deploy/ brings up glabs.cs.hm.edu: Caddy terminates TLS (HM CA via EAB) and
authenticates every request against oauth2-proxy (OIDC to sso.hm.edu),
injecting X-Remote-User authoritatively — including on `/`, so the GUI's
cookieless SSR hop can relay it to the backend. glabs-web, gui, mongo and
oauth2-proxy stay on the internal network; only Caddy publishes 80/443
(mongo binds 127.0.0.1:27017 for an SSH tunnel).

- docker-compose.yml: mongo (healthcheck + volume) + glabs-web + gui +
  oauth2-proxy + caddy, backend/gui from ghcr.io. No gh-runner.
- Caddyfile: /query* -> glabs-web:8080 (GraphQL + WS), everything else ->
  gui:3000 (glabs-web serves nothing but /query; the YAML download is a GUI
  route). No department/groups header — glabs identity is just the email.
- .env.example + .glabs-web.yaml.example (secrets/EAB/OIDC placeholders,
  gitignored real files) + README (setup, ACME/EAB, the SSR two-URL trap,
  operating, Mongo SSH tunnel, backups).

Second and final core Milestone-F PR; references the glabs-web image from #128.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant