Files
ai/Dockerfile
zeekayandClaude Opus 5 a3b3a6961e Go 1.27.1, and the code it can say more simply
Modules declare go 1.27.1 and the build images follow. go fix applied the
modernizers; omitzero is not applied, since it changes what the JSON says.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-16 19:21:01 -07:00

44 lines
842 B
Docker

# Build stage
FROM golang:1.27.1-alpine AS builder
ENV GOTOOLCHAIN=auto
WORKDIR /app
# Install build dependencies
RUN apk add --no-cache git ca-certificates
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source
COPY . .
# Build
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o lux-ai ./cmd/lux-ai
# Runtime stage
FROM alpine:3.19
WORKDIR /app
# Install runtime dependencies
RUN apk add --no-cache ca-certificates tzdata
# Copy binary from builder
COPY --from=builder /app/lux-ai /usr/local/bin/lux-ai
# Create data directory
RUN mkdir -p /data
# Expose ports
EXPOSE 9090
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:9090/health || exit 1
# Run
ENTRYPOINT ["lux-ai"]
CMD ["-port", "9090", "-data", "/data"]