Files
NixReaperandClaude Sonnet 5 56a03f9cfe
CI / lint (push) Canceled after 0s
CI / typecheck (push) Canceled after 0s
CI / unit-tests (push) Canceled after 0s
CI / integration-tests (push) Canceled after 0s
CI / container-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
Add a public API wiki at /wiki
Builds docs/ into a static site via mkdocs + mkdocs-material in its own
Docker build stage (docs-builder), so mkdocs itself never ends up in the
runtime image -- only the rendered HTML does, mounted at /wiki alongside
the existing /docs OpenAPI schema (unconditionally, unlike /docs, since
this is curated content meant to be public regardless of
AURORA_API_DOCS_ENABLED).

docs/aurora-core-spec.md (the internal build spec, referenced by "section
N" comments throughout the codebase) is excluded from the built site
entirely via exclude_docs, not just left out of the nav -- it was never
meant for public consumption.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-06 06:04:59 -05:00

56 lines
1.9 KiB
Docker

# syntax=docker/dockerfile:1
FROM python:3.12-slim AS base
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl libpq5 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
FROM base AS builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential libpq-dev \
&& rm -rf /var/lib/apt/lists/*
COPY pyproject.toml ./
COPY app ./app
# Editable install so site-packages resolves `app` by absolute path (/app)
# rather than a frozen copy — consistent with worker.Dockerfile, and keeps
# this correct even though uvicorn --reload happens to resolve its own
# import string against the CWD regardless.
RUN pip install --no-cache-dir -e .
# Builds the /wiki static site (mkdocs) in its own stage so mkdocs and its
# dependencies never end up in the runtime image -- only the rendered HTML
# does, copied in below.
FROM base AS docs-builder
RUN pip install --no-cache-dir mkdocs mkdocs-material
COPY mkdocs.yml ./
COPY docs ./docs
RUN mkdocs build --strict -d /wiki_site
FROM base AS runtime
RUN useradd --create-home --uid 1000 aurora
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
COPY app ./app
COPY migrations ./migrations
COPY alembic.ini ./alembic.ini
COPY --from=docs-builder /wiki_site ./wiki
# Owned by aurora *before* the volume mount happens — see worker.Dockerfile
# for why (a fresh named volume otherwise defaults to root-owned, which the
# non-root `aurora` user below can't write into).
RUN mkdir -p /app/media && chown -R aurora:aurora /app/media
USER aurora
EXPOSE 8000
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=5 \
CMD curl -fsS http://localhost:8000/health || exit 1
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers"]