Dockerfile 627 B

1234567891011121314151617181920
  1. FROM registry.cn-hangzhou.aliyuncs.com/hexiaoshi/python:3.10
  2. RUN apt-get update && apt-get -y install cron vim
  3. WORKDIR /app
  4. COPY . /app/
  5. RUN mv /app/crontab /etc/cron.d/crontab && chmod 0644 /etc/cron.d/crontab \
  6. && /usr/bin/crontab /etc/cron.d/crontab \
  7. && pip install --upgrade pip setuptools -i https://mirrors.aliyun.com/pypi/simple \
  8. && pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
  9. RUN find . | grep -E "(__pycache__|Dockerfile|\.pyc|\.pyo$)" | xargs rm -rf && python3 -m compileall -b . \
  10. && find . -name "*.py" |xargs rm -rf
  11. CMD ["cron", "-f"]