celery-integration
peter.fong 11 months ago
parent a6e40325de
commit 8906d40606

@ -27,5 +27,10 @@ RUN chmod 0644 /etc/cron.d/cronfile.energie
# Voeg een cronjob toe die de Python-script dagelijks uitvoert
RUN crontab /etc/cron.d/cronfile.energie
# Start de cron-demon en houd de container draaiend
CMD ["cron", "-f"]
# Voeg start.sh toe
COPY start.sh /start.sh
RUN chmod +x /start.sh
# Gebruik start.sh om zowel cron als currentprice.py te starten
CMD ["/start.sh"]

@ -4,7 +4,7 @@ version: "3.3"
services:
store_energyprices:
restart: always
container_name: Energyprices
container_name: EnergyTools
environment:
- PUID=1000
- PGID=1000

@ -0,0 +1,10 @@
#!/bin/bash
# Start de cron-demon
cron
# Start het Python-script currentprice.py
python /app/currentprice.py &
# Wacht voor altijd zodat de container draaiende blijft
tail -f /dev/null
Loading…
Cancel
Save