sp3-test-1770368381/services/chat-api/Dockerfile
jordan e77bf26608
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add service component: chat-api
2026-02-06 08:59:48 +00:00

32 lines
684 B
Docker

# Build stage
FROM golang:1.23-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/chat-api/ ./services/chat-api/
# Build from the service directory (uses replace directive for ../pkg)
RUN cd services/chat-api && CGO_ENABLED=0 go build -o /chat-api ./cmd/server
# Production stage
FROM alpine:3.19
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /
COPY --from=builder /chat-api /chat-api
EXPOSE 8001
ENTRYPOINT ["/chat-api"]