remove 30 min cron job and simplify dockerfile

This commit is contained in:
jokob-sk
2022-07-23 18:55:31 +10:00
parent 2e9f9f5b59
commit 2f85cf7c29
3 changed files with 3 additions and 6 deletions

View File

@@ -29,8 +29,7 @@ RUN groupadd --gid "${USER_GID}" "${USER}" && \
COPY . /home/pi/pialert COPY . /home/pi/pialert
# Pi.Alert # Pi.Alert
RUN sed -ie "s|TIMEZONE|${TZ}|g" /home/pi/pialert/install/pialert.cron \ RUN python /home/pi/pialert/back/pialert.py update_vendors \
&& python /home/pi/pialert/back/pialert.py update_vendors \
&& sed -ie 's/= 80/= '${PORT}'/g' /etc/lighttpd/lighttpd.conf \ && sed -ie 's/= 80/= '${PORT}'/g' /etc/lighttpd/lighttpd.conf \
&& (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab - && (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab -

View File

@@ -38,8 +38,6 @@ Default Port
4. Set the `TZ` environment variable to your current time zone (e.g.`Europe/Paris`). Find your time zone [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). 4. Set the `TZ` environment variable to your current time zone (e.g.`Europe/Paris`). Find your time zone [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
5. Database backup 5. Database backup
* The DB is stored under `/home/pi/pialert/db/pialert.db`. Map this file to a persistent location (see [Examples](https://github.com/jokob-sk/Pi.Alert/tree/main/dockerfiles#page_facing_up-examples) for details). If facing issues (AJAX errors, can't write to DB, etc, make sure permissions are set correctly, alternatively check the logs under `/home/pi/pialert/log`) * The DB is stored under `/home/pi/pialert/db/pialert.db`. Map this file to a persistent location (see [Examples](https://github.com/jokob-sk/Pi.Alert/tree/main/dockerfiles#page_facing_up-examples) for details). If facing issues (AJAX errors, can't write to DB, etc, make sure permissions are set correctly, alternatively check the logs under `/home/pi/pialert/log`)
* Automated copy
The docker image copies the DB once every 30 min to `/home/pi/pialert/config/pialert.db_bak`. If you have a backup already available, make sure you rename this file if you want to keep older backups before starting a new container. To restore the DB run: `cp /home/pi/pialert/config/pialert.db_bak /home/pi/pialert/db/pialert.db`
6. The container supports mapping to local User nad Group IDs. Specify the enviroment variables `HOST_USER_ID` and `HOST_USER_GID` if needed. 6. The container supports mapping to local User nad Group IDs. Specify the enviroment variables `HOST_USER_ID` and `HOST_USER_GID` if needed.
7. You can override the port by specifying the `PORT` env variable. 7. You can override the port by specifying the `PORT` env variable.

View File

@@ -7,9 +7,9 @@
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 # Puche 2021 pi.alert.application@gmail.com GNU GPLv3
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
TZ=TIMEZONE TZ=Europe/London
0 3 * * 1 python /home/pi/pialert/back/pialert.py update_vendors >/home/pi/pialert/log/pialert.vendors.log 2>&1 0 3 * * 1 python /home/pi/pialert/back/pialert.py update_vendors >/home/pi/pialert/log/pialert.vendors.log 2>&1
*/3 * * * * python /home/pi/pialert/back/pialert.py internet_IP >/home/pi/pialert/log/pialert.IP.log 2>&1 */3 * * * * python /home/pi/pialert/back/pialert.py internet_IP >/home/pi/pialert/log/pialert.IP.log 2>&1
*/5 * * * * python /home/pi/pialert/back/pialert.py 1 >/home/pi/pialert/log/pialert.1.log 2>&1 */5 * * * * python /home/pi/pialert/back/pialert.py 1 >/home/pi/pialert/log/pialert.1.log 2>&1
*/30 * * * * cp /home/pi/pialert/db/pialert.db /home/pi/pialert/config/pialert.db_bak