Merge commit '52c4d1f' into feat/remote-node
# Conflicts: # internal/db/db.go
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
# Headless knox node: CLI + MCP stdio + gossip sync, one static binary.
|
||||
#
|
||||
# docker build -t docker.notsosm.art/knox:latest .
|
||||
#
|
||||
# The image runs as UID 1000 and keeps all state in /data (SQLite index, TLS
|
||||
# material, anything else you mount). modernc.org/sqlite is pure Go, so the
|
||||
# build needs no cgo and the runtime needs no toolchain.
|
||||
|
||||
FROM golang:1.27-alpine AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Dependencies first so source edits do not invalidate the module cache.
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/knox .
|
||||
|
||||
FROM alpine:3.22
|
||||
RUN apk add --no-cache ca-certificates \
|
||||
&& adduser -D -u 1000 -h /home/knox knox \
|
||||
&& mkdir -p /data && chown knox:knox /data
|
||||
|
||||
COPY --from=build /out/knox /usr/local/bin/knox
|
||||
|
||||
USER knox
|
||||
WORKDIR /home/knox
|
||||
|
||||
# Persisted state: index.db (SQLite), tls/{cert,key}.pem.
|
||||
VOLUME ["/data"]
|
||||
|
||||
ENV KNOX_DB=/data/index.db
|
||||
|
||||
# 8931 gossip/REST, 8932 Prometheus metrics.
|
||||
EXPOSE 8931 8932
|
||||
|
||||
ENTRYPOINT ["knox"]
|
||||
CMD ["watch"]
|
||||
Reference in New Issue
Block a user