youtu_grpc/app/ranking/Dockerfile
xiabin 2a3ec361de
Some checks failed
/ start-services (push) Has been skipped
/ build-services (app/auth/Dockerfile, auth, auth) (push) Successful in 39s
/ build-services (app/ecpm/Dockerfile, ecpm, ecpm) (push) Successful in 37s
/ build-services (app/ranking/Dockerfile, ranking, ranking) (push) Successful in 39s
/ build-services (app/user/Dockerfile, user_manager, user) (push) Failing after 1s
update Dockerfile
2025-02-14 10:37:29 +08:00

34 lines
684 B
Docker

FROM golang:alpine AS builder
LABEL stage=gobuilder
ENV CGO_ENABLED=0
ENV GOPROXY=https://goproxy.cn,direct
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update --no-cache && apk add --no-cache tzdata
RUN apk add --no-cache git
WORKDIR /build
ADD go.mod .
ADD go.sum .
RUN go env -w GOPRIVATE=gitea.youtukeji.com.cn
RUN go mod download
COPY . .
RUN go build -ldflags="-s -w" -o /app/ranking ./app/ranking/ranking.go
FROM alpine
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai
ENV TZ=Asia/Shanghai
WORKDIR /app
COPY --from=builder /app/ranking /app/ranking
EXPOSE 8888
CMD ["/app/ranking"]