mirror of
https://github.com/Dvorinka/beszel.git
synced 2026-06-03 21:02:56 +00:00
8011d487f1
- Add status pages, incidents, badges, maintenance, bulk ops, and metrics - Add Docker packaging, env example, and frontend routes - Refresh GitHub workflows and project metadata
45 lines
1.0 KiB
Docker
45 lines
1.0 KiB
Docker
# Build stage
|
|
FROM golang:1.26.2-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache git ca-certificates unzip
|
|
|
|
# Download Go modules
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# Copy source files
|
|
COPY . ./
|
|
|
|
# Build the hub binary
|
|
RUN CGO_ENABLED=0 GOGC=75 go build -ldflags "-w -s" -o /beszel ./internal/cmd/hub
|
|
|
|
# Build the agent binary
|
|
RUN CGO_ENABLED=0 GOGC=75 go build -ldflags "-w -s" -o /beszel-agent ./internal/cmd/agent
|
|
|
|
# Final hub image
|
|
FROM scratch AS hub
|
|
|
|
COPY --from=builder /beszel /
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
VOLUME ["/beszel_data"]
|
|
EXPOSE 8090
|
|
|
|
ENTRYPOINT ["/beszel"]
|
|
CMD ["serve", "--http=0.0.0.0:8090"]
|
|
|
|
# Final agent image
|
|
FROM scratch AS agent
|
|
|
|
COPY --from=builder /beszel-agent /agent
|
|
COPY --from=builder /tmp /tmp
|
|
COPY --from=builder /app/agent/test-data/amdgpu.ids /usr/share/libdrm/amdgpu.ids
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
VOLUME ["/var/lib/beszel-agent"]
|
|
|
|
ENTRYPOINT ["/agent"]
|