FROM golang:1.25-alpine AS builder WORKDIR /build RUN apk add --no-cache git make COPY go.mod go.sum ./ RUN go mod download COPY . . RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ go build -trimpath -ldflags "-s -w" \ -o memoh-server ./cmd/agent/main.go FROM alpine:latest WORKDIR /app RUN apk add --no-cache ca-certificates tzdata wget COPY --from=builder /build/memoh-server /app/memoh-server RUN mkdir -p /var/lib/memoh/data EXPOSE 8080 HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1 CMD ["/app/memoh-server"]