Sfoglia il codice sorgente

add dockerfile crontab file

hexiaoshi 1 anno fa
parent
commit
808d8167cd
2 ha cambiato i file con 18 aggiunte e 0 eliminazioni
  1. 15 0
      Dockerfile
  2. 3 0
      crontab

+ 15 - 0
Dockerfile

@@ -0,0 +1,15 @@
+FROM registry.cn-hangzhou.aliyuncs.com/hexiaoshi/python:3.10
+
+RUN apt-get update && apt-get -y install cron vim
+
+WORKDIR /app
+
+COPY . /app/
+
+
+RUN mv /app/crontab /etc/cron.d/crontab && chmod 0644 /etc/cron.d/crontab \ 
+        && /usr/bin/crontab /etc/cron.d/crontab && pip install -r requirements.txt
+
+
+CMD ["cron", "-f"]
+

+ 3 - 0
crontab

@@ -0,0 +1,3 @@
+# START CRON JOB
+1 2 * * * python /export/python/BrandCultivation/app.py 
+# END CRON JOB