From 03cbc3cd1a18774e0e0d77a2d52de2143d72f270 Mon Sep 17 00:00:00 2001 From: clawbot Date: Mon, 9 Feb 2026 12:36:55 -0800 Subject: [PATCH] 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. --- .dockerignore | 8 ++++++++ Dockerfile | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..72f1915 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +bin/ +chatd +data.db +.env +.git +*.test +*.out +debug.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fa626c5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +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"]