feat: 🎉 初步文件确定
This commit is contained in:
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
FROM golang:1.20.14-alpine3.19 AS builder
|
||||
|
||||
WORKDIR /app/build
|
||||
|
||||
COPY go.mod .
|
||||
COPY go.sum .
|
||||
COPY main.go .
|
||||
|
||||
ENV GOPROXY https://goproxy.io
|
||||
|
||||
RUN go mod download && go build -ldflags='-s -w' -o hello_app .
|
||||
|
||||
FROM alpine
|
||||
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && apk add curl
|
||||
|
||||
ENV TZ Asia/Shanghai
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/build/hello_app .
|
||||
|
||||
CMD [ "/app/hello_app" ]
|
Reference in New Issue
Block a user