Files
phelex 88ac95dd19 Integrate Antirion admin with FastAPI and htmx
Add the shared document API, constructor and expert editors, isolated preview, and fragment catalog metadata with typed block IDs.

Include design references, specification 001, QA scripts, project guidance, and cached Docker dependency installation. Leave example sites for a separate commit.
2026-11-12 21:55:36 +03:00

30 lines
1.4 KiB
Docker

# Один том /data: data/site (контент), data/dist (опубликованное), data/state (вход и аудит).
# Статику в production лучше отдавать nginx из data/dist/current.
FROM python:3.12-slim
WORKDIR /app
COPY pyproject.toml ./
# Этот слой меняется только вместе с описанием зависимостей.
RUN --mount=type=cache,target=/root/.cache/pip python - <<'PY'
import subprocess
import sys
import tomllib
with open("pyproject.toml", "rb") as source:
config = tomllib.load(source)
project = config["project"]
requirements = [*config["build-system"]["requires"], "wheel", *project["dependencies"]]
for extra in ("server", "mcp"):
requirements.extend(project["optional-dependencies"][extra])
subprocess.check_call([sys.executable, "-m", "pip", "install", *requirements])
PY
COPY README.md ./
COPY src ./src
# Сборка локального пакета не обращается к индексу и не переустанавливает зависимости.
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-deps --no-build-isolation --no-index ".[server,mcp]" \
&& mkdir -p /data/site /data/dist /data/state
ENV SITE_ROOT=/data/site SITE_DIST=/data/dist SITE_STATE_DIR=/data/state
VOLUME ["/data"]
EXPOSE 8000
CMD ["uvicorn", "site_engine.web.app:create_app", "--factory", "--host", "0.0.0.0", "--port", "8000"]