feat: add /bootstrap snapshot, numeric UID 10001, CI gate
GET /bootstrap returns the 8 sensors, hourly series for all of them, context, meta, and versions in the CONTRACT.md shape. Snapshot artifacts are projected to contract fields once at boot; incomplete artifacts return 503. Adds tests for shape, sensor count, hourly alignment, and versions. Dockerfile now creates UID/GID 10001, uses COPY --chown=10001:10001, and runs as USER 10001:10001. Adds make check and a minimal Gitea Actions workflow that runs the same local gate: uv sync --frozen, compileall, pytest.
This commit is contained in:
1 parent
7ec4fc8bb3
commit
8656d9bc8a
6 files changed
+210
-12
No files matched your search
+9
-8
@@ -24,17 +24,18 @@ ENV PYTHONUNBUFFERED=1 \
|
||||
PULSECAST_UPLOADS=/tmp/pulsecast/uploads \
|
||||
PATH=/app/.venv/bin:$PATH
|
||||
|
||||
RUN groupadd --system app \
|
||||
&& useradd --system --gid app --home-dir /app --shell /usr/sbin/nologin app \
|
||||
&& mkdir -p /tmp/pulsecast/models /tmp/pulsecast/uploads \
|
||||
&& chown -R app:app /tmp/pulsecast
|
||||
RUN groupadd --gid 10001 app \
|
||||
&& useradd --uid 10001 --gid 10001 --home-dir /app --no-create-home \
|
||||
--shell /usr/sbin/nologin app \
|
||||
&& install -d -o 10001 -g 10001 -m 0755 \
|
||||
/tmp/pulsecast /tmp/pulsecast/models /tmp/pulsecast/uploads
|
||||
|
||||
WORKDIR /app
|
||||
COPY --chown=app:app --from=builder /app/.venv /app/.venv
|
||||
COPY --chown=app:app artifacts ./artifacts
|
||||
COPY --chown=app:app main.py README.md model_card.md ./
|
||||
COPY --chown=10001:10001 --from=builder /app/.venv /app/.venv
|
||||
COPY --chown=10001:10001 artifacts ./artifacts
|
||||
COPY --chown=10001:10001 main.py README.md model_card.md ./
|
||||
|
||||
USER app
|
||||
USER 10001:10001
|
||||
EXPOSE 8000
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
|
||||
Reference in new issue
Block a user