From e113ab52f443fa108c3145dff632b40aace5e972 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Wed, 8 Apr 2026 23:24:40 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20use=20Dockerfile.prod.tem?= =?UTF-8?q?plate=20instead=20of=20generating=20inline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci-cd.yaml | 42 +++---------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index c95f9a8..fb3bddc 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -318,48 +318,12 @@ jobs: source VERSION IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}" - # Generate Dockerfile.prod with correct dependency hash + # Use the template file with proper dependency hash replacement DEPS_HASH="${{ needs.build-cache.outputs.deps_hash }}" echo "Using dependency hash: $DEPS_HASH" - # Create Dockerfile.prod with the correct cache image tag - cat > docker/Dockerfile.prod << EOF - # dance-lessons-coach Production Docker Image - # Generated by CI/CD pipeline with dependency hash: $DEPS_HASH - - # Use the build cache image as base - FROM gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:$DEPS_HASH AS builder - - # Final minimal image - FROM alpine:3.18 - - WORKDIR /app - - # Install minimal dependencies - RUN apk add --no-cache ca-certificates tzdata - - # Copy binary from builder - COPY --from=builder /workspace/dance-lessons-coach /app/dance-lessons-coach - - # Copy configuration - COPY config.yaml /app/config.yaml - - # Set permissions - RUN chmod +x /app/dance-lessons-coach - - # Set timezone - ENV TZ=UTC - - # Expose port - EXPOSE 8080 - - # Health check - HEALTHCHECK --interval=30s --timeout=3s \ - CMD wget -q --spider http://localhost:8080/api/health || exit 1 - - # Entry point - ENTRYPOINT ["/app/dance-lessons-coach"] - EOF + # Create Dockerfile.prod from template + sed "s/{{DEPS_HASH}}/$DEPS_HASH/g" docker/Dockerfile.prod.template > docker/Dockerfile.prod TAGS="$IMAGE_VERSION latest ${{ github.sha }}" echo "Building Docker image with tags: $TAGS"