diff --git a/Dockerfile b/Dockerfile index f8b7cf04..9eeb7f1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -124,6 +124,20 @@ COPY migrations/ ./migrations/ COPY scripts/ ./scripts/ COPY wsgi.py ./ +# The two files under docs/ that the APP SERVES at runtime, not documentation. +# shopdb/core/api/docs.py resolves both relative to the repo root, so without +# them /api/docs renders the Redoc shell and then 404s fetching its own spec - +# which is what every Docker deployment did. Copied by name rather than copying +# docs/ wholesale: the rest of that tree is prose and has no business in a lean +# runtime image. +COPY docs/openapi.json docs/llms.txt ./docs/ + +# Fail the BUILD on a syntax error rather than the pod at runtime. Docker never +# imports the application, so a broken .py sails through every layer and only +# surfaces as a crash-looping container: observed, four restarts before anyone +# noticed. compileall touches nothing at runtime and costs a couple of seconds. +RUN python -m compileall -q shopdb plugins migrations wsgi.py + # Built SPA from stage 1. Flask serves it via register_frontend_routes. COPY --from=frontendbuild /build/frontend/dist ./frontend/dist diff --git a/shopdb/core/api/docs.py b/shopdb/core/api/docs.py index cbda186b..f2a5be59 100644 --- a/shopdb/core/api/docs.py +++ b/shopdb/core/api/docs.py @@ -97,50 +97,162 @@ def docs_index(): '' '' '
' '%s' '' '' '' '