x vcbxfdfsfgrfWFEFF

This commit is contained in:
Jan-Ole Hübner 2024-08-18 00:06:38 +02:00
parent c889c9f6de
commit fdad6c3d72
3 changed files with 12 additions and 7 deletions

View file

@ -20,6 +20,6 @@ RUN crontab /etc/cron.d/get_price
RUN touch /var/log/cron.log
RUN chmod 755 /app/pulse.py /app/get_price.py /app/start.sh /app/delay_price.sh
RUN chmod 755 /app/pulse.py /app/get_price.py /app/start.sh
CMD ["/app/start.sh"]

View file

@ -1,6 +0,0 @@
#!/bin/bash
source /app/env
printenv
sleep 2
python3 /app/get_price.py >> /var/log/cron.log 2>&1

View file

@ -1,11 +1,22 @@
#!/bin/bash
# Print environment variables to a file
printenv > /app/env
# Start the cron service
service cron start
# Run your main application script (pulse.py) in the background
python3 /app/pulse.py &
# Run the other script periodically in the background
(
while true; do
python3 /app/get_price.py >> /var/log/other_script.log 2>&1
sleep 3 # Sleep for 60 seconds (1 minute)
done
) &
# Keep the container running and output both cron logs and pulse.py output
tail -f /var/log/cron.log &
wait -n