chore: finalize build docker and documentation

This commit is contained in:
OpenClaw Agent
2026-09-22 03:28:14 +08:00
parent c98452b8e1
commit ae0becffec
4 changed files with 175 additions and 8 deletions
+6 -5
View File
@@ -4,14 +4,15 @@ COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG VERSION=dev
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o /out/chfs-ng ./cmd/chfs
ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG TARGETVARIANT=
RUN set -eux; GOARM=""; if [ "$TARGETARCH" = "arm" ] && [ "$TARGETVARIANT" = "v7" ]; then GOARM=7; fi; CGO_ENABLED=0 GOOS="$TARGETOS" GOARCH="$TARGETARCH" GOARM="$GOARM" go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o /out/chfs-ng ./cmd/chfs
FROM alpine:3.22
RUN apk add --no-cache ca-certificates tzdata
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /out/chfs-ng /usr/local/bin/chfs-ng
RUN mkdir -p /data && chmod 755 /data
VOLUME ["/data"]
EXPOSE 80
ENTRYPOINT ["/usr/local/bin/chfs-ng"]
CMD ["-path", "/data", "-port", "80"]
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 CMD wget -q -O - http://127.0.0.1/healthz >/dev/null || exit 1