Skip to content

Commit dc1e8f0

Browse files
author
Ariel Vernaza
committed
Build tested and working
1 parent 79de64e commit dc1e8f0

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
66

77
WORKDIR /app
88

9-
# Optional: set to 1 to install Transformer + Image embedders in the image (larger image).
9+
# Set to 1 to install Sentence Transformers in the image (large: ~2GB+ for torch). Default 0 = small image, use cohere:// for ingest-pdf.
10+
ARG INSTALL_TRANSFORMER=0
11+
# Set to 1 to add Image embedder (CLIP/ViT). Requires INSTALL_TRANSFORMER or separate install.
1012
ARG INSTALL_EMBEDDING_EXTRAS=0
1113

12-
# Install deps from lockfile (reproducible). Include pdf + embedding-transformer for POST /libraries/{id}/ingest-pdf (no Cohere key needed).
14+
# Install deps from lockfile (reproducible). PDF extra for POST /libraries/{id}/ingest-pdf.
1315
COPY pyproject.toml uv.lock ./
1416
COPY app ./app
15-
RUN uv sync --frozen --no-dev --extra pdf --extra embedding-transformer
17+
RUN uv sync --frozen --no-dev --extra pdf
1618

17-
# Optional: add Image embedder (CLIP/ViT) when building with --build-arg INSTALL_EMBEDDING_EXTRAS=1
19+
# Optional: Sentence Transformers (torch) for embedding_transformer:// without Cohere. Build with: --build-arg INSTALL_TRANSFORMER=1
20+
RUN if [ "$INSTALL_TRANSFORMER" = "1" ]; then uv sync --no-dev --extra embedding-transformer; fi
21+
# Optional: Image embedder (CLIP/ViT)
1822
RUN if [ "$INSTALL_EMBEDDING_EXTRAS" = "1" ]; then uv sync --no-dev --extra embedding-image; fi
1923

2024
# ---

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ podman build --target test -t vector-db-api-test .
454454
podman run --rm vector-db-api-test
455455
```
456456

457-
To include Transformer and Image in the **API image** (larger image): `podman build --build-arg INSTALL_EMBEDDING_EXTRAS=1 -t vector-db-api .`
457+
The **default API image** includes only the `pdf` extra (small image). Use `embedder=cohere://` for ingest-pdf (set `COHERE_API_KEY` in `.env`). To include **Sentence Transformers** in the API image (larger, ~2GB+ for torch): `podman build --build-arg INSTALL_TRANSFORMER=1 -t vector-db-api .`. To add the **Image embedder**: `--build-arg INSTALL_EMBEDDING_EXTRAS=1`.
458458

459459
### Local development (optional)
460460

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Run the Vector DB API in an isolated container.
22
# Use: docker compose up OR podman compose up
33

4+
# Default API image is small (pdf only). For ingest-pdf use embedder=cohere:// and COHERE_API_KEY.
5+
# To include Sentence Transformers (larger image): podman compose build --build-arg INSTALL_TRANSFORMER=1
46
services:
57
api:
68
build: .

0 commit comments

Comments
 (0)