2025-04-11 12:00:19 -04:00
|
|
|
FROM golang:1.24 AS agent-build
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
|
|
COPY agent/ ./agent
|
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build \
|
|
|
|
|
-trimpath \
|
|
|
|
|
-ldflags "-s -w" \
|
|
|
|
|
-o /app/hp_agent ./agent/cmd/hp_agent
|
|
|
|
|
|
2025-02-04 17:25:39 -05:00
|
|
|
FROM node:22-alpine AS build
|
2024-03-26 10:07:04 -04:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
2025-02-04 17:25:39 -05:00
|
|
|
RUN npm install -g pnpm@10
|
2024-12-05 11:35:41 -05:00
|
|
|
RUN apk add --no-cache git
|
2024-03-26 10:07:04 -04:00
|
|
|
COPY package.json pnpm-lock.yaml ./
|
2024-05-15 22:26:36 -04:00
|
|
|
COPY patches ./patches
|
2024-03-26 10:07:04 -04:00
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
RUN pnpm run build
|
|
|
|
|
|
2025-02-04 17:25:39 -05:00
|
|
|
FROM node:22-alpine
|
2025-04-11 12:00:19 -04:00
|
|
|
RUN apk add --no-cache ca-certificates
|
2025-04-03 11:26:52 -04:00
|
|
|
RUN mkdir -p /var/lib/headplane
|
2025-04-11 12:00:19 -04:00
|
|
|
RUN mkdir -p /usr/libexec/headplane
|
2025-04-03 11:26:52 -04:00
|
|
|
|
2024-03-26 10:07:04 -04:00
|
|
|
WORKDIR /app
|
2024-03-30 05:06:17 -04:00
|
|
|
COPY --from=build /app/build /app/build
|
2025-04-11 12:00:19 -04:00
|
|
|
COPY --from=agent-build /app/hp_agent /usr/libexec/headplane/agent
|
|
|
|
|
RUN chmod +x /usr/libexec/headplane/agent
|
2025-03-24 16:08:34 -04:00
|
|
|
CMD [ "node", "./build/server/index.js" ]
|