32 lines
782 B
Docker
32 lines
782 B
Docker
# Build stage
|
|
FROM golang:1.23-alpine AS builder
|
|
|
|
RUN apk add --no-cache git
|
|
|
|
# Configure Go workspace and private modules
|
|
ENV GOPRIVATE=git.threesix.ai/*
|
|
ENV GOWORK=/app/go.work
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy go workspace and all source (workspace deps are local)
|
|
# Note: go.work.sum may not exist if no external dependencies have been synced yet
|
|
COPY go.work ./
|
|
COPY go.work.su[m] ./
|
|
COPY pkg/ ./pkg/
|
|
COPY workers/background-processor/ ./workers/background-processor/
|
|
|
|
# Build from workspace root
|
|
RUN CGO_ENABLED=0 go build -o /background-processor ./workers/background-processor/cmd/worker
|
|
|
|
# Production stage
|
|
FROM alpine:3.19
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
|
|
WORKDIR /
|
|
|
|
COPY --from=builder /background-processor /background-processor
|
|
|
|
ENTRYPOINT ["/background-processor"]
|