persona-community-5/services/persona-api/Dockerfile
jordan f5f3229364
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add components: service/persona-api, worker/media-worker, app-react/creator-ui
2026-02-24 07:40:04 +00:00

36 lines
835 B
Docker

# Build stage
FROM golang:1.25-alpine AS builder
RUN apk add --no-cache git
# Configure Go private modules
# Disable workspace mode - each component builds independently with replace directives
ENV GOPRIVATE=git.threesix.ai/*
ENV GOWORK=off
WORKDIR /app
# Copy shared pkg and this service only
COPY pkg/ ./pkg/
COPY services/persona-api/ ./services/persona-api/
# Download dependencies (populates go.sum if empty)
RUN cd pkg && go mod download
RUN cd services/persona-api && go mod download
# Build from the service directory (uses replace directive for ../pkg)
RUN cd services/persona-api && CGO_ENABLED=0 go build -o /persona-api ./cmd/server
# Production stage
FROM alpine:3.19
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /
COPY --from=builder /persona-api /persona-api
EXPOSE 8001
ENTRYPOINT ["/persona-api"]