add start.sh
This commit is contained in:
parent
f889cc763c
commit
d89ae07f7b
2 changed files with 13 additions and 3 deletions
|
@ -1,6 +1,5 @@
|
|||
FROM python:3.12-bookworm
|
||||
|
||||
# Labels
|
||||
LABEL MAINTAINER="Jan-Ole Hübner <huebner@jan-ole.de>"
|
||||
|
||||
RUN apt-get update && apt-get install -y cron
|
||||
|
@ -20,6 +19,6 @@ RUN crontab /etc/cron.d/get_price
|
|||
|
||||
RUN touch /var/log/cron.log
|
||||
|
||||
RUN chmod 755 /pulse.py
|
||||
RUN chmod 755 /pulse.py /start.sh
|
||||
|
||||
CMD service cron start && python3 /pulse.py
|
||||
CMD ["./start.sh"]
|
||||
|
|
11
start.sh
Normal file
11
start.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Start the cron service
|
||||
service cron start
|
||||
|
||||
# Run your main application script (pulse.py) in the background
|
||||
python3 /pulse.py &
|
||||
|
||||
# Keep the container running and output both cron logs and pulse.py output
|
||||
tail -f /var/log/cron.log &
|
||||
wait -n
|
Loading…
Add table
Add a link
Reference in a new issue