Files
wehub-resource-sync f99010fae1
Desktop Artifacts / Desktop Build (Linux) (push) Waiting to run
Desktop Artifacts / Desktop Build (Windows) (push) Waiting to run
Desktop Artifacts / Desktop Build (Linux (arm64)) (push) Waiting to run
Desktop Artifacts (macOS) / Desktop Build (macOS (aarch64)) (push) Waiting to run
Desktop Artifacts (macOS) / Desktop Build (macOS (x86_64)) (push) Waiting to run
CI / lint (push) Failing after 1s
CI / frontend (push) Failing after 1s
CI / scripts (push) Failing after 1s
CI / Go Test (ubuntu-latest) (push) Failing after 0s
CI / frontend-node-25 (push) Failing after 1s
CI / docs (push) Failing after 0s
CI / coverage (push) Failing after 0s
CI / e2e (push) Failing after 0s
Docker / build-and-push (push) Failing after 1s
CI / integration (push) Failing after 4m43s
CI / Go Test (windows-latest) (push) Has been cancelled
CI / Desktop Unit Tests (Windows) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:30:36 +08:00

74 lines
2.3 KiB
Docker

FROM --platform=$BUILDPLATFORM node:24-bookworm AS frontend-build
WORKDIR /src/frontend
COPY frontend/package.json frontend/package-lock.json ./
# @kenn-io/kit-ui is a commit-pinned git dependency
# (github:kenn-io/kit-ui#<commit> in frontend/package.json); the repository
# is public, so npm clones it anonymously over HTTPS (git ships in the
# node:bookworm image).
RUN npm ci
COPY frontend/ ./
RUN npm run build
FROM golang:1.26.3-bookworm AS build
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
# sqlite-vec's cgo bindings (pulled in via go.kenn.io/kit/vector/sqlitevec)
# #include "sqlite3.h", which this image does not ship. Compile them against
# the header of the exact SQLite amalgamation that mattn/go-sqlite3 bundles
# and statically links, so header and linked library always match.
# "-O2 -g" restates Go's built-in default, which setting CGO_CFLAGS would
# otherwise replace, leaving the SQLite amalgamation unoptimized (2-3x
# slower queries).
RUN mkdir -p /sqlite-include \
&& cp "$(go list -m -f '{{.Dir}}' github.com/mattn/go-sqlite3)/sqlite3-binding.h" /sqlite-include/sqlite3.h
ENV CGO_CFLAGS="-O2 -g -I/sqlite-include"
COPY . ./
COPY --from=frontend-build /src/frontend/dist ./internal/web/dist
ARG TARGETOS
ARG TARGETARCH
ARG VERSION=dev
ARG COMMIT=unknown
ARG BUILD_DATE=
RUN go run ./internal/pricing/cmd/litellm-snapshot -restore
RUN CGO_ENABLED=1 GOOS=$TARGETOS GOARCH=$TARGETARCH \
go build -tags fts5 -trimpath -buildvcs=false \
-ldflags "-s -w -X main.version=${VERSION} -X main.commit=${COMMIT} -X main.buildDate=${BUILD_DATE}" \
-o /out/agentsview ./cmd/agentsview
RUN /out/agentsview --version
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /data /agents
ENV AGENTSVIEW_DATA_DIR=/data
COPY --from=build /out/agentsview /usr/local/bin/agentsview
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/agentsview /usr/local/bin/docker-entrypoint.sh
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["--host", "0.0.0.0", "--no-browser"]