fix(docker): build sans fichier VERSION pre-genere (docker compose build direct)
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:
+5
-2
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user