diff --git a/Dockerfile b/Dockerfile index aa5207e..ae41c7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ #FROM alpine:latest +#FROM alpine:3.12 FROM alpine:3.8 #FROM swoft/alphp:base #FROM swoft/alphp:cli @@ -18,7 +19,7 @@ ARG app_env=prod ENV APP_ENV=${app_env:-"prod"} \ TIMEZONE=${timezone:-"Asia/Shanghai"} \ - cron="9 11 * * 0" + cron="0 10 * * 0" ## # ---------- building ---------- @@ -26,7 +27,7 @@ ENV APP_ENV=${app_env:-"prod"} \ RUN set -ex \ # change apk source repo - # && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/' /etc/apk/repositories \ + #&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/' /etc/apk/repositories \ && apk update \ && apk add --no-cache \ # Install base packages ('ca-certificates' will install 'nghttp2-libs') @@ -62,6 +63,7 @@ RUN set -ex \ # php7-pdo_mysql \ # php7-pdo_sqlite \ # php7-phar \ + # php7-pcntl \ # php7-posix \ # php7-redis \ php7-simplexml \ @@ -75,10 +77,10 @@ RUN set -ex \ # php7-tokenizer \ php7-zip \ # php7-zlib \ - php7-xml \ - && git clone https://gitee.com/ledc/IYUUAutoReseed.git /var/www \ - && cp /var/www/config/config.sample.php /var/www/config/config.php \ - && ln -sf /var/www/config/config.php /config.php \ + php7-xml \ + && git clone https://gitee.com/ledc/IYUUAutoReseed.git /IYUU \ + && cp /IYUU/config/config.sample.php /IYUU/config/config.php \ + && ln -sf /IYUU/config/config.php /config.php \ && apk del --purge *-dev \ && rm -rf /var/cache/apk/* /tmp/* /usr/share/man /usr/share/php7 \ # ---------- some config,clear work ---------- @@ -93,7 +95,8 @@ RUN set -ex \ # - config timezone && ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \ && echo "${TIMEZONE}" > /etc/timezone \ - && echo '2 */5 * * * cd /var/www && git fetch --all && git reset --hard origin/master' >> /etc/crontabs/root \ + && echo '2 */5 * * * cd /IYUU && git fetch --all && git reset --hard origin/master' >> /etc/crontabs/root \ + && echo "${cron} /usr/bin/php /IYUU/iyuu.php &> /dev/null" >> /etc/crontabs/root \ # ---------- some config work ---------- # - ensure 'www-data' user exists(82 is the standard uid/gid for "www-data" in Alpine) # && addgroup -g 82 -S ${add_user} \ @@ -104,7 +107,7 @@ RUN set -ex \ && echo -e "\033[42;37m Build Completed :).\033[0m\n" EXPOSE 9000 -# VOLUME ["/var/www", "/data"] -WORKDIR /var/www +# VOLUME ["/IYUU", "/data"] +WORKDIR /IYUU -CMD ["sh", "-c", "/usr/bin/php /var/www/iyuu.php ; /usr/sbin/crond ; (crontab -l ;echo \"$cron /usr/bin/php /var/www/iyuu.php &> /dev/null\") | crontab - ; tail -f /dev/null"] \ No newline at end of file +CMD ["sh", "-c", "/usr/bin/php /IYUU/iyuu.php; /usr/sbin/crond; tail -f /dev/null"] \ No newline at end of file diff --git a/app/AutoReseed.php b/app/AutoReseed.php index e41dc34..44a815c 100644 --- a/app/AutoReseed.php +++ b/app/AutoReseed.php @@ -13,7 +13,7 @@ use IYUU\Library\Table; class AutoReseed { // 版本号 - const VER = '1.10.13'; + const VER = '1.10.14'; // RPC连接 private static $links = []; // 客户端配置 diff --git a/docker/AMD64/Dockerfile b/docker/AMD64/Dockerfile index 193f8d5..7a30cdf 100644 --- a/docker/AMD64/Dockerfile +++ b/docker/AMD64/Dockerfile @@ -28,6 +28,7 @@ ENV APP_ENV=${app_env:-"prod"} \ RUN set -ex \ # change apk source repo && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/' /etc/apk/repositories \ + # && sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.cn/' /etc/apk/repositories \ && apk update \ && apk add --no-cache \ # Install base packages ('ca-certificates' will install 'nghttp2-libs') @@ -78,9 +79,9 @@ RUN set -ex \ php7-zip \ # php7-zlib \ php7-xml \ - && git clone https://gitee.com/ledc/IYUUAutoReseed.git /var/www \ - && cp /var/www/config/config.sample.php /var/www/config/config.php \ - && ln -sf /var/www/config/config.php /config.php \ + && git clone https://gitee.com/ledc/IYUUAutoReseed.git /IYUU \ + && cp /IYUU/config/config.sample.php /IYUU/config/config.php \ + && ln -sf /IYUU/config/config.php /config.php \ && apk del --purge *-dev \ && rm -rf /var/cache/apk/* /tmp/* /usr/share/man /usr/share/php7 \ # ---------- some config,clear work ---------- @@ -95,7 +96,8 @@ RUN set -ex \ # - config timezone && ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \ && echo "${TIMEZONE}" > /etc/timezone \ - && echo '2 */5 * * * cd /var/www && git fetch --all && git reset --hard origin/master' >> /etc/crontabs/root \ + && echo '2 */5 * * * cd /IYUU && git fetch --all && git reset --hard origin/master' >> /etc/crontabs/root \ + && echo "${cron} /usr/bin/php /IYUU/iyuu.php &> /dev/null" >> /etc/crontabs/root \ # ---------- some config work ---------- # - ensure 'www-data' user exists(82 is the standard uid/gid for "www-data" in Alpine) # && addgroup -g 82 -S ${add_user} \ @@ -106,7 +108,7 @@ RUN set -ex \ && echo -e "\033[42;37m Build Completed :).\033[0m\n" EXPOSE 9000 -# VOLUME ["/var/www", "/data"] -WORKDIR /var/www +# VOLUME ["/IYUU", "/data"] +WORKDIR /IYUU -CMD ["sh", "-c", "/usr/bin/php /var/www/iyuu.php ; /usr/sbin/crond ; (crontab -l ;echo \"$cron /usr/bin/php /var/www/iyuu.php &> /dev/null\") | crontab - ; tail -f /dev/null"] \ No newline at end of file +CMD ["sh", "-c", "/usr/bin/php /IYUU/iyuu.php; /usr/sbin/crond; tail -f /dev/null"] \ No newline at end of file diff --git a/docker/Arm64v8/Dockerfile b/docker/Arm64v8/Dockerfile index 6ddfdda..8a0bf58 100644 --- a/docker/Arm64v8/Dockerfile +++ b/docker/Arm64v8/Dockerfile @@ -1,3 +1,4 @@ +# FROM arm64v8/alpine # FROM arm64v8/alpine:latest FROM arm64v8/alpine:3.12 @@ -20,8 +21,9 @@ RUN set -ex \ && rm -rf /var/cache/apk/* /tmp/* /usr/share/man \ && echo "${TZ}" > /etc/timezone \ && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \ - && echo '2 */6 * * * cd /IYUU && git fetch --all && git reset --hard origin/master' >> /etc/crontabs/root - -WORKDIR /IYUU + && echo '3 */6 * * * cd /IYUU && git fetch --all && git reset --hard origin/master' >> /etc/crontabs/root \ + && echo "${cron} /usr/bin/php /IYUU/iyuu.php >/dev/null 2>&1" >> /etc/crontabs/root \ + && echo '* * * * * echo "iyuu.cn" >/dev/null 2>&1' >> /etc/crontabs/root -CMD ["sh", "-c", "/usr/bin/php /IYUU/iyuu.php ; /usr/sbin/crond ; (crontab -l ;echo \"$cron /usr/bin/php /IYUU/iyuu.php &> /dev/null\") | crontab - ; tail -f /dev/null"] +WORKDIR /IYUU +CMD ["sh", "-c", "/usr/bin/php /IYUU/iyuu.php; /usr/sbin/crond; tail -f /dev/null"] \ No newline at end of file