mirror of
https://github.com/luxfi/ai.git
synced 2026-10-30 17:02:43 +00:00
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]>
44 lines
842 B
Docker
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"]
|