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/ 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"