add:Dockerfile
This commit is contained in:
parent
b7a8867716
commit
2622035dfa
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -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"
|
Loading…
x
Reference in New Issue
Block a user