deploy: containerize the live simple-mode API (Docker)
Ships the production serving path (FastAPI upload/map UI + statistical device-category identification) as a lean, reproducible container: - Dockerfile: python:3.10-slim, non-root user, /health HEALTHCHECK, serves uvicorn src.api.main_simple:app. Bakes in the joblib category model and the static rtl_433 protocol table; excludes the 11 GB test corpora and the benched Phase 3B CNN binaries. Built image is 417 MB. - requirements-prod.txt: pins matched to the versions that actually train/serve the model (scikit-learn 1.6.1 / numpy 2.2.6) so joblib.load() stays valid. torch/onnx intentionally absent — the CNN is benched, not on the serving path. - docker-compose.yml: single service, named volume seeds from baked data/ on first run then persists captures_simple.json writes across restarts. - .dockerignore: keeps data/, venv/, vendored firmware, docs out of the image. Validated: image builds, container reports healthy, and the statistical classifier loads + predicts inside the container. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# GigLez — single-service deployment of the live simple-mode API.
|
||||
# docker compose up --build → http://localhost:8000
|
||||
services:
|
||||
giglez:
|
||||
build: .
|
||||
image: giglez:latest
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
# Persist the JSON capture store across restarts. Seeded from the
|
||||
# baked-in data/ on first run (see Dockerfile), then app writes survive.
|
||||
- giglez_data:/app/data
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/health').status==200 else 1)"]
|
||||
interval: 30s
|
||||
timeout: 3s
|
||||
start_period: 15s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
giglez_data:
|
||||
Reference in New Issue
Block a user