From f06fdc4b7f596041967a07abb7f95c71785fe8f3 Mon Sep 17 00:00:00 2001 From: demo-bot Date: Sun, 9 Aug 2026 15:10:54 +0000 Subject: [PATCH] decomposer: generate files for Create a production-suitable Dockerfile and minimal Docker Compose configuration for packaging and running the completed FastAPI endpoint monitoring service. --- README.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 14854e1..380bda9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,33 @@ -# crucible-agent-create-production +# FastAPI containerizer (step 4) -> Create a production-suitable Dockerfile and minimal Docker Compose configuration for packaging and running the completed FastAPI endpoint monitoring service. +This tool **adds container files to an existing completed FastAPI repository**; it never scaffolds or replaces the application. It preserves all four input objects and emits `container_artifacts`, including exact file content and SHA-256 digests. -A tool, not a standing agent service — see `input.schema.json`/`output.schema.json` for its contract. Generated by crucible-agent-decomposer for a plan gap step; language and structure are whatever the capability actually needs, not a fixed layout. +## Preconditions + +The service must contain the configured import module (default `app.main:app`) and a `requirements.lock` containing the complete dependency closure as exact `name==version` pins. The image installs that closure with `--no-deps`, preventing undeclared dependency resolution. If `health_endpoint` is configured, generation fails unless that route literal occurs in Python source; otherwise no health check is emitted. + +## Run + +```sh +python -m pip install -e . +containerize-fastapi --input prior-step.json --service-dir /path/to/existing/service \ + --output step-4.json --verify-docker +``` + +Without `--verify-docker`, output explicitly records that Docker was not executed. With it, `container_artifacts.docker_verification` records build/up/down commands, exit codes, bounded logs, and probe status. + +Generated files and key lines: + +* `Dockerfile`: `FROM python:3.12.8-slim-bookworm`, `pip ... --no-deps -r requirements.lock`, `USER 10001:10001`, and exec-form `python -m uvicorn app.main:app ...`. +* `.dockerignore`: excludes VCS, virtualenvs, caches, secrets, tests, docs, and container files from context. +* `compose.yaml`: one `api` service, local build context, port mapping, read-only root, `/tmp` tmpfs, init, no-new-privileges, and no external services. Health check is conditional. + +## Verification + +```sh +python -m unittest discover -s tests -v +# Requires a running Docker engine and performs a real build/start/HTTP probe/stop: +./scripts/integration.sh +``` + +The integration script creates only a disposable fixture to verify this transformation tool. In normal use, artifacts are written directly into the supplied completed service repository.