Discover dashboard filters, datasets and metrics from a parsed reference URL; capture and review baseline candidates with source provenance. Improve scenario DAG and run result views, add isolated browser coverage, and align contracts and ADRs.
57 lines
2.5 KiB
Docker
57 lines
2.5 KiB
Docker
# #region docker.backend.Dockerfile [C:3] [TYPE Module] [SEMANTICS docker,backend,build]
|
||
# @BRIEF Backend Dockerfile — Python 3.11 slim + Playwright + entrypoint с установкой сертификатов.
|
||
# @LAYER Infrastructure
|
||
# @RELATION DEPENDS_ON -> [EXT:path:docker/backend.entrypoint.sh]
|
||
# @RELATION DEPENDS_ON -> [EXT:path:backend/requirements-backend.txt]
|
||
# @PRE Docker builder context — корень проекта. backend/, docker/ доступны.
|
||
# @POST Образ с backend API, Playwright, entrypoint для bootstrap admin.
|
||
|
||
FROM python:3.11-slim
|
||
|
||
ENV PYTHONDONTWRITEBYTECODE=1
|
||
ENV PYTHONUNBUFFERED=1
|
||
ENV BACKEND_PORT=8000
|
||
|
||
WORKDIR /app
|
||
|
||
# Системные зависимости
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||
ca-certificates \
|
||
curl \
|
||
git \
|
||
libnss3-tools \
|
||
&& rm -rf /var/lib/apt/lists/*
|
||
|
||
# Python зависимости — backend runtime
|
||
COPY backend/requirements-backend.txt /app/backend/requirements-backend.txt
|
||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||
pip install -r /app/backend/requirements-backend.txt
|
||
|
||
# Browser binaries are required only by screenshot-capable deployments. API-only E2E
|
||
# stacks can opt out through INSTALL_PLAYWRIGHT_BROWSERS=0 to reduce image build pressure.
|
||
ARG INSTALL_PLAYWRIGHT_BROWSERS=1
|
||
RUN if [ "$INSTALL_PLAYWRIGHT_BROWSERS" = "1" ]; then python -m playwright install --with-deps chromium; fi
|
||
|
||
# Исходный код
|
||
COPY backend/ /app/backend/
|
||
# Runtime JSON schemas used by catalog publication and capture profiles.
|
||
# baseline-pin.schema.json is referenced by baseline_resolver but absent from the source tree;
|
||
# its separate execution-path defect cannot be resolved by image packaging.
|
||
COPY specs/037-superset-baseline-engine/contracts/baseline-catalog.schema.json /app/specs/037-superset-baseline-engine/contracts/baseline-catalog.schema.json
|
||
COPY specs/038-dashboard-scenario-model/contracts/capture-profile.schema.json /app/specs/038-dashboard-scenario-model/contracts/capture-profile.schema.json
|
||
RUN test -s /app/specs/037-superset-baseline-engine/contracts/baseline-catalog.schema.json \
|
||
&& test -s /app/specs/038-dashboard-scenario-model/contracts/capture-profile.schema.json
|
||
|
||
# Копируем shared certs.sh и entrypoint
|
||
COPY docker/certs.sh /app/certs.sh
|
||
COPY docker/backend.entrypoint.sh /app/entrypoint.sh
|
||
RUN chmod +x /app/entrypoint.sh
|
||
|
||
WORKDIR /app/backend
|
||
|
||
EXPOSE 8000
|
||
|
||
ENTRYPOINT ["/app/entrypoint.sh"]
|
||
CMD ["python", "-m", "uvicorn", "src.app:app", "--host", "0.0.0.0", "--port", "8000"]
|
||
# #endregion docker.backend.Dockerfile
|