Add a self-contained docker/ package for running the ebook search app against the existing Postgres database on jeeves: - Dockerfile: python:3.14-slim image, non-root user, runs the FastAPI app on port 8070 - docker-compose.yml: service definition with library volume mount, BM25 index volume, .env loading, and a /health healthcheck - containers.py: Typer CLI (ebook-search-containers) for build/start/ stop/restart/logs/ps lifecycle management - README.md: usage and configuration docs
37 lines
880 B
YAML
37 lines
880 B
YAML
name: ebook-search
|
|
|
|
services:
|
|
ebook-search:
|
|
build:
|
|
context: ../../..
|
|
dockerfile: python/ebook_search/docker/Dockerfile
|
|
image: ebook-search:latest
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${EBOOK_SEARCH_PORT:-8070}:8070"
|
|
extra_hosts:
|
|
- "jeeves:192.168.90.40"
|
|
env_file:
|
|
- ../../../.env
|
|
environment:
|
|
EBOOK_SEARCH_HOST: "0.0.0.0"
|
|
EBOOK_SEARCH_PORT: "8070"
|
|
EBOOK_SEARCH_LIBRARY_PATHS: "/library"
|
|
EBOOK_SEARCH_BM25_INDEX_DIR: "/data/bm25"
|
|
volumes:
|
|
- "${EBOOK_LIBRARY_HOST_PATH:-/home/richie/ebooks}:/library:ro"
|
|
- ebook-search-data:/data
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"curl -fsS http://127.0.0.1:8070/health >/dev/null || exit 1",
|
|
]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
volumes:
|
|
ebook-search-data:
|