From 968d9956e984592e67c25c39a7f198e2579eac87 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:19:50 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20Attempt=202:=20Use=20actual=20do?= =?UTF-8?q?cker/Dockerfile=20(no=20inline)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 62 +------------------------------ 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 1e4f879..bbcbc69 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -61,66 +61,8 @@ jobs: TAGS="$IMAGE_VERSION latest ${{ github.sha }}" echo "Building Docker image with tags: $TAGS" - # Build the production image using inline version of docker/Dockerfile - docker build -t dance-lessons-coach -f - . <<'EOF' - # dance-lessons-coach Docker Image - # Multi-stage build for production deployment - - # Stage 1: Build binary - FROM golang:1.26.1-alpine AS builder - - WORKDIR /app - - # Copy go mod files - COPY go.mod go.sum ./ - RUN go mod download - - # Copy source code - COPY . ./ - - # Install swag and generate Swagger docs only if they don't exist - RUN if [ ! -f pkg/server/docs/swagger.json ]; then \ - echo "📝 Generating Swagger documentation..." && \ - go install github.com/swaggo/swag/cmd/swag@latest && \ - cd pkg/server && go generate && \ - echo "✅ Swagger documentation generated"; \ - else \ - echo "✅ Swagger documentation already exists, skipping swag installation and generation"; \ - fi - - # Build binary - RUN CGO_ENABLED=0 GOOS=linux go build -o /dance-lessons-coach ./cmd/server - - # Stage 2: Final image - FROM alpine:3.18 - - WORKDIR /app - - # Install dependencies - RUN apk add --no-cache ca-certificates tzdata - - # Copy binary from builder - COPY --from=builder /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 + # Build the production image using actual docker/Dockerfile (no inline) + docker build -t dance-lessons-coach -f docker/Dockerfile . for TAG in $TAGS; do IMAGE_NAME="${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:$TAG"