feat(ebook): add Docker packaging and lifecycle tooling
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
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
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:
|
||||
Reference in New Issue
Block a user