trying to fix dockerfile
Some checks failed
Mindforge Cronjob Build and Deploy / Build Mindforge Cronjob Image (push) Failing after 21s
Mindforge Cronjob Build and Deploy / Deploy Mindforge Cronjob (internal) (push) Has been skipped

This commit is contained in:
2026-03-13 22:12:31 -03:00
parent aa430b1758
commit fe24b6771b
2 changed files with 7 additions and 8 deletions

View File

@@ -4,16 +4,18 @@ FROM --platform=$BUILDPLATFORM golang:1.22-alpine AS builder
ARG TARGETARCH
ARG TARGETOS
# Install CA certificates in the builder (runs natively, no QEMU needed)
RUN apk --no-cache add ca-certificates
WORKDIR /app
COPY . .
# Build statically for Linux
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o mindforge-cronjob main.go
# Use Alpine for running, with CA certificates for TLS
FROM alpine:latest
WORKDIR /app
RUN apk --no-cache add ca-certificates
COPY --from=builder /app/mindforge-cronjob .
# Use scratch to avoid QEMU: no foreign-arch commands to emulate
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /app/mindforge-cronjob /app/mindforge-cronjob
ENV GIT_REPOSITORY=""
ENV GEMINI_API_KEY=""
ENV OPENAI_API_KEY=""