mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-01-08 17:06:17 +00:00
move cron/ to containers/cron/
This commit is contained in:
16
containers/cron/Dockerfile-cron
Normal file
16
containers/cron/Dockerfile-cron
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM ubuntu:latest
|
||||
|
||||
# Instalar cron
|
||||
RUN apt-get update && apt-get install -y cron curl
|
||||
|
||||
# Adicionar seus scripts de cron
|
||||
COPY cron_tasks /etc/cron.d/cron_tasks
|
||||
|
||||
# Dar permissões apropriadas
|
||||
RUN chmod 0644 /etc/cron.d/cron_tasks
|
||||
|
||||
# Criar um arquivo de log para armazenar os resultados do cron
|
||||
RUN touch /var/log/cron.log
|
||||
|
||||
# Executar o cron em primeiro plano
|
||||
CMD cron -f
|
||||
3
containers/cron/cron_tasks
Normal file
3
containers/cron/cron_tasks
Normal file
@@ -0,0 +1,3 @@
|
||||
* * * * * root /usr/bin/curl -s http://wireguard-webadmin:8000/api/cron_check_updates/ >> /var/log/cron.log 2>&1
|
||||
*/10 * * * * root /usr/bin/curl -s http://wireguard-webadmin:8000/api/cron_update_peer_latest_handshake/ >> /var/log/cron.log 2>&1
|
||||
* * * * * root /usr/bin/curl -s http://wireguard-webadmin:8000/api/cron_refresh_wireguard_status_cache/ >> /var/log/cron.log 2>&1
|
||||
Reference in New Issue
Block a user