Dockerfile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. FROM kevinwan/goctl as image-dev
  2. RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
  3. RUN apk update && apk add --no-cache make supervisor busybox-extras git gcc g++
  4. RUN mkdir -p /etc/supervisor.d/
  5. FROM kevinwan/goctl as builder
  6. RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
  7. RUN apk update && apk add --no-cache supervisor busybox-extras git vim
  8. ENV WORKDIR /app
  9. WORKDIR ${WORKDIR}
  10. RUN mkdir -p /etc/supervisor.d/ && mkdir -p /tmp/charts
  11. COPY aihub-dag-jupyter /tmp/charts/aihub-dag-jupyter
  12. RUN cd /tmp/charts && tar cvfz aihub-dag-jupyter.tgz aihub-dag-jupyter
  13. ADD helmwrapper .
  14. ADD config-example.yaml .
  15. RUN chmod a+x helmwrapper
  16. COPY dag-jupyter dag-jupyter
  17. RUN cd dag-jupyter && go env -w GOPROXY=https://goproxy.cn,direct && go mod vendor && go build -o main
  18. RUN echo -e "\
  19. [program:be]\n\
  20. directory=/app/dag-jupyter\n\
  21. command=/app/dag-jupyter/main -f etc/jupyter-api.yaml\n\
  22. autorestart=true\n\
  23. startretries=1000\n\
  24. redirect_stderr=true\n\
  25. stdout_logfile=/var/log/be.log\n\
  26. stdout_logfile_maxbytes=50MB\n\
  27. " > /etc/supervisor.d/be.ini
  28. EXPOSE 8080
  29. RUN echo -e "\
  30. [program:helm]\n\
  31. directory=/app\n\
  32. command=/app/helmwrapper --config /app/config-example.yaml --kubeconfig config.yaml --port 8081\n\
  33. autorestart=true\n\
  34. startretries=1000\n\
  35. redirect_stderr=true\n\
  36. stdout_logfile=/var/log/helm.log\n\
  37. stdout_logfile_maxbytes=50MB\n\
  38. ;environment=GIN_MODE=release\n\
  39. " > /etc/supervisor.d/helm.ini
  40. EXPOSE 8081
  41. ENTRYPOINT ["supervisord", "-n"]
  42. FROM builder as image-sxkj
  43. # kubeconfig
  44. COPY config-sxkj.yaml config.yaml
  45. FROM builder as image-idctest
  46. # kubeconfig
  47. COPY config-idctest.yaml config.yaml
  48. FROM builder as image-idcprod
  49. # kubeconfig
  50. COPY config-idcprod.yaml config.yaml
  51. FROM builder as image-txtest
  52. # kubeconfig
  53. COPY config-txtest.yaml config.yaml
  54. FROM builder as image-txprod
  55. # kubeconfig
  56. COPY config-txprod.yaml config.yaml