From 9d2c74c059153bffc9ef00a126ee899cae915698 Mon Sep 17 00:00:00 2001 From: jwansek Date: Sat, 8 Jul 2023 19:42:04 +0100 Subject: Added docker stuff --- cron_Dockerfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 cron_Dockerfile (limited to 'cron_Dockerfile') 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 -- cgit v1.2.3