Dockerfile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #前端预构建
  2. # FROM cmfont-cache:latest as builderFont
  3. # COPY /client .
  4. # RUN cnpm run build
  5. # 后端预构建
  6. #FROM cm-gocache:latest AS builder
  7. # FROM golang:1.15-alpine AS builder
  8. # RUN go env -w GO111MODULE=on
  9. # RUN go env -w GOPROXY=https://goproxy.cn,direct
  10. # COPY . /go/src/construction_management
  11. # # 编译
  12. # WORKDIR /go/src/construction_management/web
  13. # RUN ls ./
  14. # #install 执行文件会生成在 gopath/bin 中
  15. # RUN go mod tidy
  16. # RUN go install ./
  17. # # 正式镜像
  18. # FROM alpine:3.13
  19. # # 安装nginx
  20. # RUN echo http://mirrors.aliyun.com/alpine/v3.10/main>/etc/apk/repositories && \
  21. # echo http://mirrors.aliyun.com/alpine/v3.10/community>>/etc/apk/repositories
  22. # RUN apk update && apk upgrade \
  23. # && apk add nginx \
  24. # && mkdir /run/nginx \
  25. # && touch /run/nginx.pid && \
  26. # # chmod 755 /run.sh && \
  27. # apk del m4 autoconf make gcc g++ linux-headers
  28. # RUN find / -name ngnix.pid
  29. # # 复制配置文件和前端文件
  30. # # COPY --from=builder /go/src/construction_management/deployment/default.conf /etc/nginx/conf.d
  31. # # COPY --from=builderFont /build /var/www/html/client
  32. # # 后端相关
  33. # # 把编译环境中编译好的 chat 复制到生产镜像中的 bin/chat 文件名称 不是目录
  34. # #COPY --from=builder /go/bin/chat /bin/chat
  35. # # /chat 放到根目录
  36. # COPY --from=builder /go/bin/web /server
  37. # COPY --from=builder /go/src/construction_management/server/web/config-debug.yaml /config-debug.yaml
  38. # COPY --from=builder /go/src/construction_management/server/web/config-uat.yaml /config-uat.yaml
  39. # COPY --from=builder /go/src/construction_management/server/web/config-pro.yaml /config-pro.yaml
  40. # RUN mkdir -p /lib
  41. # COPY --from=builder /go/src/construction_management/server/lib/*.json /lib/
  42. # RUN chmod 777 /lib/*.json
  43. # RUN chmod 777 /server
  44. # RUN chmod 777 /config-debug.yaml
  45. # RUN chmod 777 /config-uat.yaml
  46. # RUN chmod 777 /config-pro.yaml
  47. # ENV ADDR=:6060
  48. # # 申明暴露的端口
  49. # EXPOSE 80
  50. # EXPOSE 6060
  51. # # 设置服务入口
  52. # # ENTRYPOINT ["/run.sh"]
  53. # ENTRYPOINT ["sh","-c", "/server" ]
  54. # FROM centos:7
  55. FROM alpine:3.13
  56. ADD /bin/ /
  57. RUN chmod 777 /construction_management
  58. ENV PARAMS=""
  59. EXPOSE 6060
  60. ENTRYPOINT ["sh","-c","/construction_management $PARAMS"]