-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (29 loc) · 1.21 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (29 loc) · 1.21 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
# syntax=docker/dockerfile:1.7
FROM node:22.17.1-bookworm-slim AS webui
WORKDIR /src/crates/agent-gateway/web
RUN npm install -g pnpm@10.32.1
COPY crates/agent-gateway/web/package.json crates/agent-gateway/web/pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY crates/agent-gateway/web ./
RUN pnpm build
FROM golang:1.25-bookworm AS gateway-builder
ARG TARGETOS=linux
ARG TARGETARCH=amd64
WORKDIR /src/crates/agent-gateway
COPY crates/agent-gateway/go.mod crates/agent-gateway/go.sum ./
RUN go mod download
COPY crates/agent-gateway ./
COPY --from=webui /src/crates/agent-gateway/web/dist ./web/dist
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -trimpath -ldflags="-s -w" -o /out/liveagent-gateway ./cmd/gateway
FROM debian:bookworm-slim AS runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --system --uid 10001 --home-dir /nonexistent --shell /usr/sbin/nologin liveagent
COPY --from=gateway-builder /out/liveagent-gateway /usr/local/bin/liveagent-gateway
USER liveagent
ENV PORT=8080
ENV LIVEAGENT_GATEWAY_GRPC_ADDR=:50051
EXPOSE 8080 50051
ENTRYPOINT ["/usr/local/bin/liveagent-gateway"]