You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
520 B
15 lines
520 B
# 编译
|
|
FROM golang:1.16-alpine3.13
|
|
COPY . /build/
|
|
WORKDIR /build
|
|
RUN GOPROXY=https://goproxy.cn GOSUMDB=off CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags '-w -s' -o server
|
|
# 运行阶段 基础镜像加上时区
|
|
FROM kanadekumo/alpine
|
|
# 从编译阶段的中拷贝编译结果到当前镜像中
|
|
COPY --from=0 /build/server /
|
|
# 拷贝配置文件
|
|
COPY --from=0 /build/config/app.ini /data/config/app.ini
|
|
COPY --from=0 /build/config/app.test.ini /data/config/app.test.ini
|
|
WORKDIR /data
|
|
ENTRYPOINT ["/server"]
|