- Client: Go-based Windows hardware monitoring (CPU, GPU, memory, disk, network, power) - Server: Go + Gin + SQLite backend with REST API - Frontend: Vue 3 + Element Plus dashboard - Docker deployment support - Windows service installation script
35 lines
547 B
Docker
35 lines
547 B
Docker
FROM golang:1.21-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache gcc musl-dev
|
|
|
|
# Copy server code
|
|
COPY server/ .
|
|
|
|
# Download dependencies
|
|
RUN go mod download
|
|
|
|
# Build the server
|
|
RUN CGO_ENABLED=1 GOOS=linux go build -o server -ldflags="-s -w" .
|
|
|
|
# Final stage
|
|
FROM alpine:3.19
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy binary from builder
|
|
COPY --from=builder /app/server .
|
|
|
|
# Create data directory
|
|
RUN mkdir -p /app/data
|
|
|
|
# Expose port
|
|
EXPOSE 8080
|
|
|
|
# Run the server
|
|
CMD ["./server"]
|