Files
wx-win-agent/control-plane/Dockerfile
T
rogee 13c31fc902
Build web service image / build (push) Successful in 1m53s
feat: add remote control plane and whitelist reads
2026-09-12 09:46:05 +08:00

29 lines
847 B
Docker

# syntax=docker/dockerfile:1
FROM node:22-bookworm-slim AS web-build
WORKDIR /src/web
COPY web/package*.json ./
RUN npm ci --no-audit --no-fund
COPY web/ ./
RUN npm run build
FROM golang:1.23-bookworm AS go-build
WORKDIR /src
COPY go.mod ./
COPY . ./
COPY --from=web-build /src/web/dist ./web/dist
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -trimpath -ldflags="-s -w" \
-o /out/wxagent-control-plane ./cmd/wxagent-control-plane
RUN mkdir /runtime-data
FROM gcr.io/distroless/static-debian12:nonroot
WORKDIR /app
COPY --from=go-build /out/wxagent-control-plane /app/wxagent-control-plane
COPY --from=go-build --chown=65532:65532 /runtime-data /data
ENV WXAGENT_CONTROL_PLANE_ADDR=0.0.0.0:8090 \
WXAGENT_CONTROL_PLANE_DATA=/data/control-plane-data.json
VOLUME ["/data"]
EXPOSE 8090
ENTRYPOINT ["/app/wxagent-control-plane"]