-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (37 loc) · 1.36 KB
/
Dockerfile
File metadata and controls
55 lines (37 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM --platform=$BUILDPLATFORM node:24-bookworm AS frontend-build
WORKDIR /src/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
FROM golang:1.26-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
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 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"]