From e0f31b049a41f94bae83307c3455817595c7c259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E7=95=91=E3=81=B2=E3=81=A8=E3=81=97?= Date: Sun, 23 Aug 2026 10:35:14 +0900 Subject: [PATCH 1/2] Distribution: start from the published image instead of building it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `docker compose up` built the image on the user's machine — apt, then pip, before the first screen appears, on a laptop that has no reason to compile anything. It also meant the pull count the previous commit set up to measure would stay at zero: publishing an image nobody pulls counts nothing. Compose now points at jiniie/cli2ui:latest (amd64 and arm64, pushed on `v*` tags), so starting the app is a pull. Building from source moves to docker-compose.override.yml.example, where it belongs: copy it and you get `build: .` plus the working-tree mount, i.e. the old behaviour with live reload. CLI2UI_IMAGE in .env pins a version. Dropping the `.:/app` mount from the default path moves the management DB, so CLI2UI_DB_PATH now points at /data on a named volume — otherwise saved connections and auto-backups would live inside the container and vanish on the next `up`. The override puts it back in the project root, where a developer can inspect or delete it from the host. README and both landing pages say which of the two you are getting. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01UJoGRWhksAqQttFdTZYRSm --- .gitignore | 2 ++ README.md | 10 ++++++++++ docker-compose.override.yml.example | 21 +++++++++++++++++++++ docker-compose.yml | 15 +++++++++++++-- docs/index.en.html | 1 + docs/index.ja.html | 1 + 6 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 docker-compose.override.yml.example diff --git a/.gitignore b/.gitignore index f9ce6b8..89c4c0d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ venv/ /seed/demo/.extract/ /*.png *.code-workspace +# Developer build/live-reload override — copied from the .example, kept local. +docker-compose.override.yml # Local, never-committed working area (strategy notes, drafts, scratch). /local/ diff --git a/README.md b/README.md index 93deeb2..d3700de 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,19 @@ them, and it auto-detects your browser's language on first visit. docker compose up ``` +This pulls the published image +([`jiniie/cli2ui`](https://hub.docker.com/r/jiniie/cli2ui), amd64 and arm64) — +there is nothing to build and nothing to compile. + Then open . The connection form is pre-filled to point at a bundled sample database — just hit **Connect** and you'll see its tables. +> **Building from source instead:** copy `docker-compose.override.yml.example` +> to `docker-compose.override.yml`. It builds the image from your working tree +> and mounts the tree for live reload — that is the development setup. +> +> **Pinning a version:** set `CLI2UI_IMAGE=jiniie/cli2ui:1.3.0` in `.env`. + To point at your own PostgreSQL, change the form fields (host, port, db, user, password) and connect. diff --git a/docker-compose.override.yml.example b/docker-compose.override.yml.example new file mode 100644 index 0000000..e702878 --- /dev/null +++ b/docker-compose.override.yml.example @@ -0,0 +1,21 @@ +# Developer live-reload override (optional). +# +# End users do NOT need this — `docker compose up` pulls the published image. +# For development, copy this file to docker-compose.override.yml; Compose merges +# it automatically, builds from your working tree instead of pulling, and mounts +# the tree so code changes are picked up without rebuilding: +# +# cp docker-compose.override.yml.example docker-compose.override.yml +# +services: + app: + # Build from this working tree rather than pulling the published image. + build: . + volumes: + - .:/app + # The mount above shadows /app, so the management DB goes back to the + # project root (db.sqlite3, gitignored) — the pre-image default, and handy + # when you want to inspect or delete it from the host. + - /data + environment: + CLI2UI_DB_PATH: /app/db.sqlite3 diff --git a/docker-compose.yml b/docker-compose.yml index 41280a8..340bb3a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,20 @@ services: app: - build: . + # The published image by default, so the first run is a pull rather than a + # multi-minute apt/pip build on a laptop that has no reason to compile + # anything. To build from your working tree instead, copy + # docker-compose.override.yml.example — Compose merges it and its `build:` + # wins. Pin a version with CLI2UI_IMAGE (e.g. jiniie/cli2ui:1.3.0). + image: ${CLI2UI_IMAGE:-jiniie/cli2ui:latest} ports: - "8000:8000" + environment: + # Saved connections and auto-backups live in one SQLite file. Without the + # source tree mounted it would sit inside the container and disappear the + # next time the container is recreated, so put it on a named volume. + CLI2UI_DB_PATH: /data/db.sqlite3 volumes: - - .:/app + - cli2ui-data:/data # Lets you reach a database running elsewhere on the host (another container # that publishes a port, or a native install) by connecting cli2ui to # host.docker.internal. Docker Desktop (Mac/Windows) provides this name @@ -72,3 +82,4 @@ services: volumes: airlines-data: + cli2ui-data: diff --git a/docs/index.en.html b/docs/index.en.html index 712ed49..9d467fd 100644 --- a/docs/index.en.html +++ b/docs/index.en.html @@ -344,6 +344,7 @@

Up and running in one command<
docker compose up
+
# pulls the published image — nothing to build
# then open http://localhost:8000
# port 8000 taken? remap in docker-compose.yml: "8001:8000"
diff --git a/docs/index.ja.html b/docs/index.ja.html index 785c23f..d64150b 100644 --- a/docs/index.ja.html +++ b/docs/index.ja.html @@ -344,6 +344,7 @@

1コマンドで起動

docker compose up
+
# 公開イメージを pull する(ビルド待ちなし)
# ブラウザで http://localhost:8000 を開く
# 8000 が使用中なら docker-compose.yml で変更: "8001:8000"
From 5fc87373baf0cb9eb50ff48a864b0a650d4703a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E7=95=91=E3=81=B2=E3=81=A8=E3=81=97?= Date: Sun, 23 Aug 2026 10:53:24 +0900 Subject: [PATCH 2/2] Distribution: keep the working-only directories out of a tree-built image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The published image is clean — CI builds from a checkout of the public repo, so files that are only ever gitignored do not exist there. A developer's tree is different: `COPY . .` takes whatever is sitting in it, and `.dockerignore` listed only caches, the venv and the SQLite file. That matters more now that `build: .` is the documented development path. A locally built image would embed local/, .env and the editor working directories, and that image is one `docker push` from being public. Verified by building from this tree and listing /app: none of them land. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01UJoGRWhksAqQttFdTZYRSm --- .dockerignore | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.dockerignore b/.dockerignore index 86c5987..fb700d2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,3 +5,13 @@ db.sqlite3 .venv/ venv/ .DS_Store + +# Never let a locally built image embed the working-only directories. The CI +# build starts from a clean checkout so it never sees these, but `build: .` +# from a developer's tree would copy them straight into the image — and that +# image is one `docker push` away from being public. +.env +/local/ +.claude/ +.continue/ +.playwright-mcp/