最简单快速的定时调用一个http接口

使用docker实现定时调用某个HTTP接口,原理是定时执行wget命令

version: '2'
services:
  cron:
    image: inutano/wget
    container_name: nextcloud-cron
    entrypoint: |
      sh -c 'sh -s <<EOF
      trap "break;exit" SIGHUP SIGINT SIGTERM
      while /bin/true; do
        wget -O /dev/null -q http://app/cron.php
        sleep 15m
      done
      EOF'
    restart: always

评论