Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d271a786d2 | |||
| 005d0aa683 | |||
| 57624f5953 |
+42
@@ -0,0 +1,42 @@
|
||||
# Build stage
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
ENV GOTOOLCHAIN=auto
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy go mod files
|
||||
COPY server/go.mod server/go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy source code
|
||||
COPY server/ ./
|
||||
COPY agent/ ../agent/
|
||||
|
||||
# Build server
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /nuyue-server ./cmd/server
|
||||
|
||||
# Build agent
|
||||
RUN cd ../agent && CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /nuyue-agent ./cmd/agent
|
||||
|
||||
# Runtime stage
|
||||
FROM alpine:3.19
|
||||
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy binaries
|
||||
COPY --from=builder /nuyue-server /app/
|
||||
COPY --from=builder /nuyue-agent /app/
|
||||
|
||||
# Copy frontend (built by CI)
|
||||
COPY server/embed/dist /app/embed/dist
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 8080 9090
|
||||
|
||||
# Run server
|
||||
CMD ["/app/nuyue-server"]
|
||||
Reference in New Issue
Block a user