paths.py drops the sibling-directory walk (frontend is now the repo root: static/ and content/ are its own subdirectories, no more sibling walk needed). New Dockerfile (much smaller deps -- fastapi, uvicorn, httpx, jinja2, PyYAML -- no entrypoint script needed at all, frontend has no migrations/pre-boot logic). content/ is a committed starter copy for now, not yet real cross-repo vendoring from thermograph-copy (that repo doesn't exist yet) -- noted in paths.py's own docstring. Real, known gap flagged rather than silently skipped: this process cannot boot standalone (content.register() fetches the IndexNow key from backend at import time with no retry, by design), so build.yml only verifies the image builds, not a live boot+healthz check -- that needs a genuine cross-repo contract-test job (booting a real backend too), separate follow-up work. Same reason tests/ doesn't run here yet (its conftest.py still imports backend's own test fixtures via a sibling path that no longer exists) -- noted directly in the file.
31 lines
951 B
Docker
31 lines
951 B
Docker
# Thermograph frontend: server-rendered content pages, the interactive tool's
|
|
# SPA shells, and every static asset. Split from the monorepo (repo-split
|
|
# Stage 7). No migrations, no DB, no pre-boot logic -- a plain shell-form CMD
|
|
# is enough (unlike backend, no separate entrypoint script needed).
|
|
FROM python:3.12-slim
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt /tmp/requirements.txt
|
|
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
|
|
|
COPY . /app/
|
|
|
|
RUN useradd --system --create-home --uid 10001 thermograph \
|
|
&& chown -R thermograph:thermograph /app
|
|
|
|
USER thermograph
|
|
WORKDIR /app
|
|
|
|
ENV PORT=8080 \
|
|
THERMOGRAPH_BASE=/ \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=40s --retries=3 \
|
|
CMD curl -fsS http://127.0.0.1:${PORT}/healthz || exit 1
|
|
|
|
CMD uvicorn app:app --host 0.0.0.0 --port ${PORT}
|