feat(docker): production nginx image published to GHCR#268
Merged
Conversation
Replace the containerized Python local-runner with a static nginx server for the single-file SPA, and publish it multi-arch to ghcr.io/altinity/altinity-sql-browser. - Dockerfile: node build stage → nginxinc/nginx-unprivileged (non-root uid 101, port 8080). Serves the baked SPA + a mounted config.json, CONNECT_SRC env fills the CSP connect-src, HEALTHCHECK on /healthz, ASB_VERSION build-arg keeps the in-app build stamp in lockstep with the image tag. - deploy/nginx/default.conf.template: serves /sql, /sql/dashboard (same SPA), /sql/config.json, /healthz, / → /sql; gzip; security headers + CSP mirroring deploy/http_handlers.xml. - .github/workflows/docker.yml: multi-arch (amd64+arm64) build via buildx/metadata-action; PR = build-only, main = :edge + :sha-, tag v* = :X.Y.Z + :latest (part of the release). - deploy/config.json.example: runnable demo (antalya + github.demo, each in demo:demo and Google-SSO modes) baked in as the default served config. Google clients are public-by-design with host-locked redirect URIs (hard rule 3 / Altinity/ClickHouse#1930). - docker-compose.yaml + deploy/k8s/deployment.yaml: nginx model — config via mount/ConfigMap, port 8080, /healthz + /sql/config.json probes, non-root securityContext, resources. - README + CHANGELOG updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FvjXR2rzh6v5EBUzBbsvFV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the containerized Python local-runner with a static nginx server for the single-file SPA, and publishes it multi-arch to
ghcr.io/altinity/altinity-sql-browseras part of the release. The image ships a runnable democonfig.json(antalya + github.demo, each indemo:demoand Google-SSO modes) sodocker runworks out of the box; mount your ownconfig.jsonto override.Nothing proxies queries — the browser POSTs SQL cross-origin to the chosen cluster, exactly like the on-ClickHouse
http_handlersdeployment.Changes
Dockerfile— Node build stage →nginxinc/nginx-unprivileged(non-root uid 101, port 8080).CONNECT_SRCenv fills the CSPconnect-src;HEALTHCHECKon/healthz;ASB_VERSIONbuild-arg keeps the in-app build stamp in lockstep with the image tag.deploy/nginx/default.conf.template(new) — serves/sql,/sql/dashboard(same SPA),/sql/config.json,/healthz,/→/sql; gzip; security headers + CSP mirroringdeploy/http_handlers.xml..github/workflows/docker.yml(new) — multi-arch (amd64+arm64) buildx +metadata-action. PR = build-only;main=:edge+:sha-; tagv*=:X.Y.Z+:latest.deploy/config.json.example— the 4-entry demo, baked in as the default served config.docker-compose.yaml,deploy/k8s/deployment.yaml— nginx model: config via mount/ConfigMap, port 8080,/healthz+/sql/config.jsonprobes, non-rootsecurityContext, resources.README.md,CHANGELOG.mdupdated.Verified (real container)
HEALTHCHECKhealthy ✓/sql200text/html; charset=utf-8, full CSP (connect-src = Google + both clusters) ✓ · gzip 1.21 MB → 437 KB ✓/sql/dashboard200 ✓ ·/healthz✓ ·/→ relativeLocation: /sql✓config.jsonoverride ✓ ·CONNECT_SRCenv → CSP ✓ · build stamp ✓src//tests//build//schemas/changes → coverage/tsc gate unaffected.Notes
chmodnormalize),charsetinsidedefault_typedefeating text/html gzip (usecharsetdirective),HEALTHCHECKvialocalhost→::1(use127.0.0.1).config.json.examplenow also carries github.demo's Google client secret — public-by-design host-locked web clients (hard rule 3 / Feature: Server-side OAuth2 code exchange to support secure client login flow ClickHouse#1930), consistent with the antalya secret already indeploy/sql-browser.xml. Push protection allow-listed by the maintainer.localhost(host-locked redirect URIs — usedemo:demo); cross-origin queries need cluster CORS (public demos allow it).🤖 Generated with Claude Code