add Dockerfile

This commit is contained in:
starryskymeow
2025-07-05 06:23:04 +08:00
parent 49d90848d8
commit 9cf6b6777a

21
Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM golang:1.24.0-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /app/manager ./cmd/manager
FROM alpine:latest
WORKDIR /root/
COPY --from=builder /app/manager .
EXPOSE 8080
CMD ["./manager"]