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:
2026-07-12 16:12:40 -04:00
parent f4c4b11ff8
commit f5ec88f1e5
5 changed files with 355 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
# Ebook Search Docker
Run the EPUB search app against the existing Postgres database on `jeeves`:
```sh
ebook-search-containers start --library-path /path/to/epubs --build
```
All ebook-search Docker files live in this directory:
- `Dockerfile`
- `docker-compose.yml`
- `containers.py`
- `container.py`
The app listens on `http://localhost:8070`.
Useful lifecycle commands:
```sh
ebook-search-containers build
ebook-search-containers start --library-path /path/to/epubs
ebook-search-containers logs
ebook-search-containers ps
ebook-search-containers stop
```
Direct compose usage from the repo root:
```sh
docker compose -f python/ebook_search/docker/docker-compose.yml ps
```
The compose service also loads the repo root `.env` into the container via `env_file`.
Mount your EPUB directory by setting `EBOOK_LIBRARY_HOST_PATH` in an env file or on the command line. The container sees it as `/library`, and `EBOOK_SEARCH_LIBRARY_PATHS` is set to `/library` inside the container.
Database connection settings are controlled by `RICHIE_DB`, `RICHIE_HOST`, `RICHIE_PORT`, `RICHIE_USER`, and `RICHIE_PASSWORD`. The default host is `jeeves`.
Startup runs the Richie Alembic migrations automatically after creating the `main` schema and `vector` extension.