2026-08-18 13:25:49 +02:00
|
|
|
ARG SOURCE_SET_DIGEST=unknown
|
|
|
|
|
|
2026-10-11 02:47:02 +02:00
|
|
|
FROM docker.io/nginxinc/nginx-unprivileged@sha256:15c994d10d6d78658721c3bcafff14cb281fba2a4bdf9d5ba92c416a472516e3 AS runtime-base
|
|
|
|
|
|
|
|
|
|
# Preserve the full upstream module set while applying fixed Alpine packages.
|
|
|
|
|
USER root
|
|
|
|
|
RUN apk add --no-cache --upgrade tiff=4.7.2-r0 zlib=1.3.2-r1
|
|
|
|
|
USER 101:101
|
2026-08-18 12:16:04 +02:00
|
|
|
|
|
|
|
|
ARG VCS_REVISION=unknown
|
2026-08-18 13:25:49 +02:00
|
|
|
ARG SOURCE_SET_DIGEST
|
2026-08-18 12:16:04 +02:00
|
|
|
LABEL org.opencontainers.image.title="policy-nexus" \
|
|
|
|
|
org.opencontainers.image.description="Canonical Coulomb policy publication surface" \
|
|
|
|
|
org.opencontainers.image.source="https://forgejo.coulomb.social/coulomb/policy-nexus" \
|
2026-08-18 13:25:49 +02:00
|
|
|
org.opencontainers.image.revision="$VCS_REVISION" \
|
|
|
|
|
org.coulomb.policy.source-set-digest="$SOURCE_SET_DIGEST"
|
2026-08-18 12:16:04 +02:00
|
|
|
|
|
|
|
|
COPY --chown=101:101 deploy/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
|
|
|
|
|
|
USER 101:101
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
|
|
|
|
|
FROM runtime-base AS local-artifact
|
|
|
|
|
COPY --chown=101:101 build/ /usr/share/nginx/html/
|
|
|
|
|
|
|
|
|
|
FROM docker.io/library/python@sha256:d09d15e60962ca365d1cd544a48773bac9d33f2fb1b00f2aa0deec78ade7dc31 AS release-builder
|
2026-10-19 15:03:35 +02:00
|
|
|
# Staged-source review tests exercise real Git index semantics. Builder only.
|
|
|
|
|
RUN apk add --no-cache git
|
2026-08-18 13:25:49 +02:00
|
|
|
ARG SOURCE_SET_DIGEST
|
|
|
|
|
ENV POLICY_NEXUS_SOURCE_ROOT=/workspace/_sources
|
2026-08-18 12:16:04 +02:00
|
|
|
WORKDIR /workspace/policy-nexus
|
|
|
|
|
COPY . /workspace/policy-nexus
|
2026-08-18 13:25:49 +02:00
|
|
|
COPY _sources /workspace/_sources
|
|
|
|
|
RUN python3 -m unittest discover -s tests -p 'test_*.py' \
|
2026-08-18 12:16:04 +02:00
|
|
|
&& python3 tools/build_site.py publication.json --output build \
|
2026-08-18 13:25:49 +02:00
|
|
|
&& python3 tools/source_inventory.py check \
|
|
|
|
|
--source-root /workspace/_sources \
|
|
|
|
|
--lock /workspace/_sources/source-lock.json \
|
|
|
|
|
--report build/source-inventory.json \
|
|
|
|
|
&& test "$(python3 -c 'import json; print(json.load(open("/workspace/_sources/source-lock.json"))["source_set_digest"])')" = "$SOURCE_SET_DIGEST" \
|
2026-10-11 02:28:04 +02:00
|
|
|
&& cp /workspace/_sources/source-lock.json build/source-lock.json \
|
2026-08-18 12:16:04 +02:00
|
|
|
&& python3 tools/verify_release.py build \
|
|
|
|
|
&& python3 tools/check_currency.py publication.json
|
|
|
|
|
|
|
|
|
|
FROM runtime-base AS release-artifact
|
|
|
|
|
COPY --from=release-builder --chown=101:101 /workspace/policy-nexus/build/ /usr/share/nginx/html/
|