feat(R4b): reproducible builds — pin requirements.lock checksum
- Dockerfile: build-arg REQUIREMENTS_CHECKSUM verifica lo sha256 del lockfile (fallisce la build se non coincide; vuoto = skip locale) - docker-compose.yml: default = hash corrente del lock - CI: nuovo job checksum.yml che fallisce se il pin non coincide - Fix YAML preesistente in ci.yml (name: con ':' non quotati) - Docs: README, .env.example, review aggiornati
This commit is contained in:
1 parent
0f15b7958f
commit
12d2018ac5
7 files changed
+78
-10
No files matched your search
@@ -1,8 +1,17 @@
|
||||
FROM python:3.12-slim-bookworm AS builder
|
||||
|
||||
# Build riproducibile (R4b): se REQUIREMENTS_CHECKSUM è valorizzato, la
|
||||
# build fallisce se requirements.lock non coincide — nessuna dipendenza può
|
||||
# cambiare senza aggiornare il pin. Genera con:
|
||||
# sha256sum requirements.lock | awk '{print $1}'
|
||||
ARG REQUIREMENTS_CHECKSUM=""
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY requirements.txt requirements.lock ./
|
||||
RUN test -z "$REQUIREMENTS_CHECKSUM" \
|
||||
-o "$(sha256sum requirements.lock | awk '{print $1}')" = "$REQUIREMENTS_CHECKSUM" \
|
||||
|| { echo "FATAL: requirements.lock non corrisponde a REQUIREMENTS_CHECKSUM" >&2; exit 1; }
|
||||
RUN python -m venv /opt/venv \
|
||||
&& /opt/venv/bin/pip install --no-cache-dir --upgrade pip \
|
||||
&& /opt/venv/bin/pip install --no-cache-dir -r requirements.lock
|
||||
|
||||
Reference in new issue
Block a user