diff options
Diffstat (limited to 'cron_Dockerfile')
-rw-r--r-- | cron_Dockerfile | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cron_Dockerfile b/cron_Dockerfile new file mode 100644 index 0000000..99a9525 --- /dev/null +++ b/cron_Dockerfile @@ -0,0 +1,16 @@ +FROM ubuntu:latest
+MAINTAINER Eden Attenborough "eda@e.email"
+ENV TZ=Europe/London
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+RUN apt-get update -y
+RUN apt-get install -y python3-pip cron
+RUN mkdir app
+COPY . /app
+WORKDIR /app
+RUN touch .docker
+RUN pip3 install -r requirements.txt
+
+RUN echo "*/1 * * * * root python3 /app/devices.py nothourly > /proc/1/fd/1 2>/proc/1/fd/2" > /etc/crontab
+RUN echo "@hourly root python3 /app/devices.py hourly > /proc/1/fd/1 2>/proc/1/fd/2" >> /etc/crontab
+ENTRYPOINT ["bash"]
+CMD ["entrypoint.sh"]
\ No newline at end of file |