fix(docker): build sans fichier VERSION pre-genere (docker compose build direct)
CI / lint (push) Failing after 23s
CI / test (push) Skipped
CI / build (push) Skipped
CI / e2e (push) Skipped
CI / security (push) Successful in 32s

backend/VERSION est gitignore (genere par build.sh/CI) donc le COPY
echouait sur un clone propre. Remplace par le COPY backend/ existant +
ARG VERSION avec RUN fallback ; docker-compose.yml injecte VERSION via
build args. docker compose build --no-cache fonctionne desormais sans
build.sh.
This commit is contained in:
2026-09-02 08:41:45 -04:00
parent ef7a3ff1ed
commit d20e623f0c
2 changed files with 9 additions and 2 deletions
+5 -2
View File
@@ -31,8 +31,11 @@ RUN apt-get update \
COPY backend/ ./backend/
COPY frontend/ ./frontend/
# Copy pre-generated VERSION file (generated by build.sh before docker build)
COPY backend/VERSION ./backend/VERSION
# Bake version: build.sh/CI pre-generate backend/VERSION (copied above);
# plain `docker compose build` has no such file (gitignored) — fall back
# to the VERSION build arg so the image always carries a version string.
ARG VERSION=0.0.0-dev
RUN test -f backend/VERSION || echo "$VERSION" > backend/VERSION
# Create non-root user for security + data directory for auth persistence
# Using explicit UID/GID 1000 to match common host user and docker-compose settings
+4
View File
@@ -11,6 +11,10 @@ services:
obsigate:
build:
context: .
args:
# VERSION est injecte par build.sh/CI via `git describe` ;
# sans variable d'env, l'image tombe sur 0.0.0-dev (fallback Dockerfile).
VERSION: ${VERSION:-0.0.0-dev}
image: obsigate:latest
container_name: obsigate
user: "1000:1000"