添加 Dockerfile
This commit is contained in:
11
Dockerfile
Normal file
11
Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user