-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (53 loc) · 1.81 KB
/
Copy pathdocker-compose.yml
File metadata and controls
56 lines (53 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Run the Vector DB API and UI in containers. Nothing runs on the host.
# Use: podman compose up OR docker compose up
# Default API image includes pdf + Sentence Transformers (Cohere and Transformer work in UI).
services:
api:
build: .
image: vector-db-api:latest
container_name: vector-db-api
ports:
- "8000:8000"
environment:
- COHERE_API_KEY=${COHERE_API_KEY:-}
# Optional: HF_TOKEN for higher rate limits when downloading Sentence Transformers models
- HF_TOKEN=${HF_TOKEN:-}
# Optional: override CMD for dev (e.g. --reload) via:
# command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/')"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
ui:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: ${VITE_API_URL:-http://localhost:8000}
image: vector-db-ui:latest
container_name: vector-db-ui
ports:
- "3000:80"
depends_on:
api:
condition: service_healthy
# Lint (Ruff) and tests using the test image. Mounts source so you lint/tests current code.
# Build: docker compose build lint OR podman compose build lint
# Lint: docker compose run --rm lint OR podman compose run --rm lint
# Tests: docker compose run --rm lint uv run pytest -v
lint:
build:
context: .
dockerfile: Dockerfile
target: test
image: vector-db-api-test:latest
volumes:
- ./app:/app/app:ro
- ./tests:/app/tests:ro
- ./pyproject.toml:/app/pyproject.toml:ro
working_dir: /app
command: ["sh", "-c", "uv run ruff check . && uv run ruff format --check ."]
profiles:
- lint