Dockerfile
This commit is contained in:
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM python:3.8-slim-buster
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install cron
|
||||
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
|
||||
RUN pip install paho-mqtt
|
||||
RUN echo "*/2 * * * * /usr/local/bin/python /app/src/rpi-cpu2mqtt.py > /proc/1/fd/1 2>/proc/1/fd/2" > /etc/cron.d/crontab
|
||||
RUN chmod 0644 /etc/cron.d/crontab
|
||||
RUN /usr/bin/crontab /etc/cron.d/crontab
|
||||
CMD ["cron", "-f"]
|
||||
|
||||
Reference in New Issue
Block a user