fix: pulse not running
This commit is contained in:
parent
659ea7c3fb
commit
f889cc763c
1 changed files with 1 additions and 11 deletions
12
Dockerfile
12
Dockerfile
|
@ -3,33 +3,23 @@ FROM python:3.12-bookworm
|
||||||
# Labels
|
# Labels
|
||||||
LABEL MAINTAINER="Jan-Ole Hübner <huebner@jan-ole.de>"
|
LABEL MAINTAINER="Jan-Ole Hübner <huebner@jan-ole.de>"
|
||||||
|
|
||||||
# Install cron
|
|
||||||
RUN apt-get update && apt-get install -y cron
|
RUN apt-get update && apt-get install -y cron
|
||||||
|
|
||||||
# Add the requirements
|
|
||||||
ADD requirements.txt /
|
ADD requirements.txt /
|
||||||
RUN pip3 install -r /requirements.txt
|
RUN pip3 install -r /requirements.txt
|
||||||
|
|
||||||
# Environment
|
|
||||||
ENV PYTHONIOENCODING=utf-8
|
ENV PYTHONIOENCODING=utf-8
|
||||||
|
|
||||||
# Add the application code
|
|
||||||
ADD . /
|
ADD . /
|
||||||
|
|
||||||
# Add the cron job
|
|
||||||
RUN echo "*/15 * * * * python3 /get_price.py >> /var/log/cron.log 2>&1" > /etc/cron.d/get_price
|
RUN echo "*/15 * * * * python3 /get_price.py >> /var/log/cron.log 2>&1" > /etc/cron.d/get_price
|
||||||
|
|
||||||
# Give execution rights on the cron job
|
|
||||||
RUN chmod 0644 /etc/cron.d/get_price
|
RUN chmod 0644 /etc/cron.d/get_price
|
||||||
|
|
||||||
# Apply the cron job
|
|
||||||
RUN crontab /etc/cron.d/get_price
|
RUN crontab /etc/cron.d/get_price
|
||||||
|
|
||||||
# Create the log file to be able to run tail
|
|
||||||
RUN touch /var/log/cron.log
|
RUN touch /var/log/cron.log
|
||||||
|
|
||||||
# Chmod for your main application script
|
|
||||||
RUN chmod 755 /pulse.py
|
RUN chmod 755 /pulse.py
|
||||||
|
|
||||||
# Run the command on container startup
|
CMD service cron start && python3 /pulse.py
|
||||||
CMD cron && tail -f /var/log/cron.log
|
|
Loading…
Add table
Add a link
Reference in a new issue