chat/Dockerfile
clawbot 03cbc3cd1a Add Dockerfile and .dockerignore
Multi-stage build: golang:1.24-alpine builder, alpine:3.21 runtime.
Verified locally: all fx modules instantiate, migrations run,
healthcheck responds at /.well-known/healthcheck.json.
2026-02-09 12:36:55 -08:00

23 lines
374 B
Docker

FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG VERSION=dev
RUN go build -ldflags "-X main.Version=${VERSION}" -o /chatd ./cmd/chatd
FROM alpine:3.21
RUN apk add --no-cache ca-certificates
COPY --from=builder /chatd /usr/local/bin/chatd
WORKDIR /data
EXPOSE 8080
ENTRYPOINT ["chatd"]