Files
pc-monitor/Dockerfile.server
672 0e8c9f7bff feat: init pc-monitor project
- 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
2026-05-17 01:29:44 +08:00

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"]