testgo2/services/api/Dockerfile
jordan 8378b24ffa
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Add service component: api
2026-02-01 20:40:03 +00:00

31 lines
602 B
Docker

# Build stage
FROM golang:1.23-alpine AS builder
RUN apk add --no-cache git
# Tell Go not to use proxy for our private modules
ENV GOPRIVATE=git.threesix.ai/*
WORKDIR /app
# Copy go workspace and all source (workspace deps are local)
COPY go.work go.work.sum* ./
COPY pkg/ ./pkg/
COPY services/api/ ./services/api/
# Build (go will download external deps automatically)
RUN cd services/api && CGO_ENABLED=0 go build -o /api ./cmd/server
# Production stage
FROM alpine:3.19
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /
COPY --from=builder /api /api
EXPOSE 8001
ENTRYPOINT ["/api"]