Dockerfile 793 B

1234567891011121314151617181920212223242526272829
  1. FROM golang:1.20 AS builder
  2. WORKDIR /app
  3. COPY server .
  4. ARG GOODS=linux
  5. ARG GOARCH=amd64
  6. RUN go env -w GOPROXY=https://goproxy.cn,direct
  7. RUN --mount=type=cache,target=/go --mount=type=cache,target=/root/.cache/go-build\
  8. GOODS=${GOODS} GOARCH=${GOARCH} go build -o /app/app
  9. FROM debian:sid-slim
  10. WORKDIR /app
  11. COPY --from=builder /app/app /app
  12. COPY server/conf /app/conf
  13. COPY server/data /app/data
  14. #COPY ../server/static /app/static
  15. COPY dist /app/static/web
  16. RUN chmod +x /app/app
  17. RUN rm -rf /app/static/web/config.js
  18. #RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
  19. #RUN sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
  20. #RUN echo "deb http://mirrors.ustc.edu.cn/debian sid main" >> /etc/apt/sources.list
  21. ENTRYPOINT ["/app/app"]