Skip to content

Commit ece39be

Browse files
committed
docs(docker): one-liner compose install + env-overridable image
- README: bash/zsh one-liner using `docker compose -f <(curl ...)`, plus keep the clone-the-file path for non-POSIX shells. - docker-compose.yml: `image:` now reads `${COCOINDEX_CODE_IMAGE:-...}` so users can switch to `:full` or GHCR without editing the file. - pyproject: scope mypy to `src/` and collapse single-entry extras arrays.
1 parent 90d8ff9 commit ece39be

3 files changed

Lines changed: 18 additions & 15 deletions

File tree

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,25 +219,30 @@ The rest of this section uses `:latest` — substitute `:full` in the `image:` /
219219
220220
### Quick start — `docker compose up -d`
221221

222-
Grab [`docker/docker-compose.yml`](./docker/docker-compose.yml) from this repo and run:
222+
Bring it up in one line — no clone needed (bash / zsh):
223223

224224
```bash
225225
# macOS / Windows
226-
docker compose up -d
226+
docker compose -f <(curl -L https://raw.githubusercontent.com/cocoindex-io/cocoindex-code/refs/heads/main/docker/docker-compose.yml) up -d
227227

228228
# Linux (aligns file ownership on bind-mounted paths with your host user)
229-
PUID=$(id -u) PGID=$(id -g) docker compose up -d
229+
PUID=$(id -u) PGID=$(id -g) docker compose -f <(curl -L https://raw.githubusercontent.com/cocoindex-io/cocoindex-code/refs/heads/main/docker/docker-compose.yml) up -d
230230
```
231231

232+
Or grab [`docker/docker-compose.yml`](./docker/docker-compose.yml) and run `docker compose up -d` next to it (works on any shell, including Windows cmd / PowerShell).
233+
232234
By default your home directory is mounted into the container (set
233235
`COCOINDEX_HOST_WORKSPACE` to narrow this to a specific code folder). Index
234236
data and the embedding model cache persist in a Docker volume across
235237
restarts. Your global settings file at `$HOME/.cocoindex_code/global_settings.yml`
236238
is visible and editable on the host; edits take effect on your next `ccc` command.
237239

238-
> **GHCR:** to pull from GitHub Container Registry instead of Docker Hub,
239-
> change the `image:` line in your copy of `docker-compose.yml` to
240-
> `ghcr.io/cocoindex-io/cocoindex-code:latest`.
240+
> **Pick a different image:** set `COCOINDEX_CODE_IMAGE` to override the
241+
> default. For example, the `:full` variant or GHCR:
242+
> ```bash
243+
> COCOINDEX_CODE_IMAGE=cocoindex/cocoindex-code:full docker compose up -d
244+
> COCOINDEX_CODE_IMAGE=ghcr.io/cocoindex-io/cocoindex-code:latest docker compose up -d
245+
> ```
241246
242247
### Or: `docker run`
243248

docker/docker-compose.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
# workspace. Set COCOINDEX_HOST_WORKSPACE=/path/to/code to mount a narrower
1111
# directory instead.
1212
#
13-
# Using GHCR instead of Docker Hub? Change the image below to
14-
# `ghcr.io/cocoindex-io/cocoindex-code:latest`.
13+
# Override the image via COCOINDEX_CODE_IMAGE — for example:
14+
# COCOINDEX_CODE_IMAGE=cocoindex/cocoindex-code:full docker compose up -d
15+
# COCOINDEX_CODE_IMAGE=ghcr.io/cocoindex-io/cocoindex-code:latest docker compose up -d
1516

1617
services:
1718
cocoindex-code:
18-
image: cocoindex/cocoindex-code:latest
19+
image: ${COCOINDEX_CODE_IMAGE:-cocoindex/cocoindex-code:latest}
1920
container_name: cocoindex-code
2021
volumes:
2122
- ${COCOINDEX_HOST_WORKSPACE:-${HOME}}:/workspace

pyproject.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,15 @@ dependencies = [
3939
# `embeddings-local` is the primary feature extra: it pulls in
4040
# `sentence-transformers` (via cocoindex) so local embeddings work without
4141
# an API key.
42-
embeddings-local = [
43-
"cocoindex[sentence-transformers]==1.0.0a43",
44-
]
42+
embeddings-local = ["cocoindex[sentence-transformers]==1.0.0a43"]
4543
# `full` is the umbrella "batteries-included" alias. Today it's just
4644
# `embeddings-local`, but we expect to bundle more optional niceties under
4745
# it over time — users who want everything can keep using `[full]` and pick
4846
# up the additions automatically. The name also matches the Docker
4947
# `:full` image variant for consistency across install paths. Contents are
5048
# inlined rather than self-referencing `cocoindex-code[embeddings-local]`
5149
# to avoid resolver edge cases with older pip.
52-
full = [
53-
"cocoindex[sentence-transformers]==1.0.0a43",
54-
]
50+
full = ["cocoindex[sentence-transformers]==1.0.0a43"]
5551
dev = [
5652
"pytest>=7.0.0",
5753
"pytest-asyncio>=0.21.0",
@@ -110,6 +106,7 @@ python_version = "3.11"
110106
strict = true
111107
ignore_missing_imports = true
112108
explicit_package_bases = true
109+
files = ["src"]
113110

114111
[tool.pytest.ini_options]
115112
testpaths = ["tests"]

0 commit comments

Comments
 (0)