Files
chat/Dockerfile
clawbot c7bcedd8d4
All checks were successful
check / check (push) Successful in 1m31s
fix: pin golangci-lint install to commit SHA (fixes #13)
- Fix Dockerfile: use correct v2 module path with commit SHA
  (github.com/golangci/golangci-lint/v2/cmd/golangci-lint@eabc2638...)
- Add CGO_ENABLED=0 for alpine compatibility
- Fix 35 lint issues found by golangci-lint v2.1.6:
  - Remove unused nolint directives, add nolintlint where needed
  - Pre-allocate migrations slice
  - Use t.Context() instead of context.Background() in tests
  - Fix blank lines between comments and exported functions in ui.go
2026-02-26 20:20:31 -08:00

30 lines
791 B
Docker

# golang:1.24-alpine, 2026-02-26
FROM golang@sha256:8bee1901f1e530bfb4a7850aa7a479d17ae3a18beb6e09064ed54cfd245b7191 AS builder
RUN apk add --no-cache git build-base
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Run all checks — build fails if branch is not green
# golangci-lint v2.1.6
RUN CGO_ENABLED=0 go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@eabc2638a66daf5bb6c6fb052a32fa3ef7b6600d
RUN make check
ARG VERSION=dev
RUN go build -ldflags "-X main.Version=${VERSION}" -o /chatd ./cmd/chatd
# alpine:3.21, 2026-02-26
FROM alpine@sha256:c3f8e73fdb79deaebaa2037150150191b9dcbfba68b4a46d70103204c53f4709
RUN apk add --no-cache ca-certificates
COPY --from=builder /chatd /usr/local/bin/chatd
WORKDIR /data
EXPOSE 8080
ENTRYPOINT ["chatd"]