From 09a3637b56670f353cc2bed7975382d2f4912d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=8C?= <259278618@qq.com> Date: Fri, 26 Jun 2026 09:07:38 +0800 Subject: [PATCH] =?UTF-8?q?common=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile.bak | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Dockerfile.bak diff --git a/Dockerfile.bak b/Dockerfile.bak new file mode 100644 index 0000000..2600889 --- /dev/null +++ b/Dockerfile.bak @@ -0,0 +1,31 @@ +# 阶段1: 构建 +FROM golang:alpine AS builder + +RUN apk add --no-cache git ca-certificates tzdata + +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +ENV GO111MODULE=on +ENV GOPROXY=https://goproxy.cn,direct +ENV CGO_ENABLED=0 +ENV GOTOOLCHAIN=auto +WORKDIR /build + +COPY . . + +RUN go mod download && go mod tidy + +RUN go build -ldflags="-s -w" -o main ./main.go + + +# 阶段2: 运行时(继承 media-deps 基础镜像) +FROM redfuture-media-deps:latest + +# 复制二进制和运行时必需的文件 +COPY --from=builder /build/main . +COPY --from=builder /build/config.yml . +COPY --from=builder /build/scripts ./scripts +EXPOSE 3010 + +CMD ["./main"]