Dockerfile 724 B

123456789101112131415161718192021222324252627282930
  1. FROM golang:alpine as builder
  2. MAINTAINER zhixueyun
  3. ENV GOPROXY https://goproxy.cn/
  4. RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
  5. RUN apk update && apk add tzdata make git
  6. WORKDIR /hx
  7. COPY . ./hx-admin-server
  8. RUN go env -w GOPRIVATE=git.cestong.com.cn
  9. RUN git config --global url."https://liubing:r4QQ3iATeoXT3CoV8Dwm@git.cestong.com.cn".insteadOf https://git.cestong.com.cn
  10. WORKDIR /hx/hx-admin-server
  11. RUN make build-prod
  12. FROM alpine
  13. COPY --from=builder /hx/hx-admin-server/bin/hx-admin-server /hx/hx-admin-server
  14. COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  15. EXPOSE 8000
  16. WORKDIR /hx
  17. CMD ["/hx/hx-admin-server","server","-c", "/hx/config/settings.yml"]