Dockerfile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. FROM debian11_py3.9.13_gdal3.4.3_small:1.0.0
  2. COPY ./requirements.txt /tmp/
  3. COPY ./conf/bootstrap.sh /opt/bootstrap.sh
  4. COPY ./conf/supervisord.conf /etc/
  5. COPY ./conf/supervisor.conf /etc/supervisord.d/supervisor.conf
  6. RUN apt-get update -y \
  7. && apt-get upgrade -y \
  8. && apt-get install -y \
  9. supervisor \
  10. gcc g++ \
  11. vim net-tools \
  12. curl \
  13. apt-utils \
  14. && pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip setuptools \
  15. && pip install \
  16. --index-url https://pypi.tuna.tsinghua.edu.cn/simple \
  17. -r /tmp/requirements.txt \
  18. # 默认是128,当server处理请求较慢,以至于socket监听队列被填满后,新来的请求会被拒绝。
  19. && mkdir /opt/init \
  20. && echo "echo 2048 > /proc/sys/net/core/somaxconn" > /opt/init/sysctl.sh \
  21. && chmod +x /opt/bootstrap.sh \
  22. # 清理和删除工作
  23. && apt-get autoremove -y \
  24. && apt-get autoclean -y \
  25. && apt-get clean -y \
  26. && rm -rf /tmp/* /var/tmp/* \
  27. && find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
  28. && find /var/cache -type f -delete \
  29. && find /var/log -type f | while read f; do echo -n '' > ${f}; done \
  30. && rm -rf /var/lib/apt/lists/* \
  31. && rm -rf ~/.cache/pip/*
  32. ENTRYPOINT ["/opt/bootstrap.sh"]
  33. EXPOSE 5000