-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 832 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (26 loc) · 832 Bytes
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
# ---- Build Stage ----
FROM golang:1.25-alpine AS builder
ARG VERSION=dev
ARG COMMIT=unknown
ARG DATE=unknown
ARG GOPROXY=https://proxy.golang.org,direct
WORKDIR /src
COPY go.mod go.sum ./
RUN GOPROXY=${GOPROXY} go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOPROXY=${GOPROXY} go build \
-ldflags="-s -w \
-X main.version=${VERSION} \
-X main.commit=${COMMIT} \
-X main.date=${DATE}" \
-o /agent-usage .
# ---- Runtime Stage ----
FROM alpine:3.21
# Copy CA certs from builder (needed for HTTPS pricing sync)
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
RUN mkdir -p /data /sessions/claude /sessions/codex
COPY --from=builder /agent-usage /agent-usage
COPY config.docker.yaml /etc/agent-usage/config.yaml
EXPOSE 9800
VOLUME ["/data"]
ENTRYPOINT ["/agent-usage"]