添加 Dockerfile

This commit is contained in:
XOF
2025-12-14 21:41:59 +08:00
parent 3c0b636d96
commit 01ef4236b4

11
Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
FROM golang:1.25-alpine AS builder
WORKDIR /build
COPY main.go .
RUN go build -ldflags="-s -w" -o app main.go
FROM alpine:latest
WORKDIR /app
COPY --from=builder /build/app .
RUN chmod +x app
EXPOSE 8080
CMD ["./app"]