All checks were successful
release-tag / release-image (push) Successful in 2m30s
22 lines
773 B
Docker
22 lines
773 B
Docker
FROM golang:1.26-alpine AS build
|
|
WORKDIR /src
|
|
|
|
# modernc.org/sqlite is a pure-Go database/sql driver; no compiler toolchain or
|
|
# CGO runtime is required. Dependencies are resolved in a separate layer so
|
|
# normal source changes do not redownload the SQLite module tree.
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY cmd ./cmd
|
|
COPY internal ./internal
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -mod=mod -trimpath -ldflags="-s -w" -o /out/neural-brain ./cmd/brain
|
|
|
|
FROM alpine:3.24
|
|
RUN addgroup -S brain && adduser -S -G brain brain
|
|
WORKDIR /app
|
|
COPY --from=build /out/neural-brain /usr/local/bin/neural-brain
|
|
RUN mkdir -p /app/data /sources/knowledge /sources/staging /sources/agent-data && chown -R brain:brain /app /sources
|
|
USER brain
|
|
EXPOSE 8090
|
|
ENTRYPOINT ["neural-brain"]
|