diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3bc363e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +#编译阶段镜像 +FROM golang:alpine AS builder + +WORKDIR /app + +COPY . . + +RUN go env -w GOPRIVATE="gitea.youtukeji.com.cn" +RUN go env -w GOPROXY="https://goproxy.cn,direct" +RUN go mod tidy +RUN go build -o /app/ecpm cmd/main.go + +#运行阶段镜像 +FROM alpine AS runtime + +WORKDIR /app + +COPY --from=builder /app/ecpm /app/ecpm + +ENV TZ=Asia/Shanghai +ENV APP_ENV=prod +ENV LOG_PATH=/app/data/logs/ecpm.log + +ENTRYPOINT ["/app/ecpm"] + +LABEL authors="xiabin"