27 lines
453 B
Docker
27 lines
453 B
Docker
|
#编译阶段镜像
|
||
|
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"
|