mirror of
https://gitee.com/ledc/IYUUAutoReseed
synced 2025-05-19 16:05:21 +00:00
优化docker
This commit is contained in:
parent
815156b252
commit
849370e26a
@ -96,7 +96,7 @@ RUN set -ex \
|
||||
&& ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
|
||||
&& echo "${TIMEZONE}" > /etc/timezone \
|
||||
&& 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 \
|
||||
#&& 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} \
|
||||
@ -109,5 +109,4 @@ RUN set -ex \
|
||||
# EXPOSE 9000
|
||||
# VOLUME ["/IYUU", "/data"]
|
||||
WORKDIR /IYUU
|
||||
|
||||
CMD ["sh", "-c", "/usr/bin/php /IYUU/iyuu.php; /usr/sbin/crond; tail -f /dev/null"]
|
||||
ENTRYPOINT ["/IYUU/docker/entrypoint.sh"]
|
@ -13,7 +13,7 @@ use IYUU\Library\Table;
|
||||
class AutoReseed
|
||||
{
|
||||
// 版本号
|
||||
const VER = '1.10.15';
|
||||
const VER = '1.10.16';
|
||||
// RPC连接
|
||||
private static $links = [];
|
||||
// 客户端配置
|
||||
|
@ -19,7 +19,7 @@ ARG app_env=prod
|
||||
|
||||
ENV APP_ENV=${app_env:-"prod"} \
|
||||
TIMEZONE=${timezone:-"Asia/Shanghai"} \
|
||||
cron="8 14 * * *"
|
||||
cron="3 11 * * *"
|
||||
|
||||
##
|
||||
# ---------- building ----------
|
||||
@ -27,8 +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.aliyun.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')
|
||||
@ -97,7 +96,7 @@ RUN set -ex \
|
||||
&& ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
|
||||
&& echo "${TIMEZONE}" > /etc/timezone \
|
||||
&& 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 \
|
||||
#&& 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} \
|
||||
@ -110,5 +109,4 @@ RUN set -ex \
|
||||
# EXPOSE 9000
|
||||
# VOLUME ["/IYUU", "/data"]
|
||||
WORKDIR /IYUU
|
||||
|
||||
CMD ["sh", "-c", "/usr/bin/php /IYUU/iyuu.php; /usr/sbin/crond; tail -f /dev/null"]
|
||||
ENTRYPOINT ["/IYUU/docker/entrypoint.sh"]
|
@ -23,7 +23,8 @@ RUN set -ex \
|
||||
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||
# && echo '* * * * * echo "iyuu.cn" >/dev/null 2>&1' >> /etc/crontabs/root \
|
||||
&& 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 "${cron} /usr/bin/php /IYUU/iyuu.php >/dev/null 2>&1" >> /etc/crontabs/root \
|
||||
&& echo -e "\033[42;37m Build Completed :).\033[0m\n"
|
||||
|
||||
WORKDIR /IYUU
|
||||
CMD ["sh", "-c", "/usr/bin/php /IYUU/iyuu.php; /usr/sbin/crond; tail -f /dev/null"]
|
||||
ENTRYPOINT ["/IYUU/docker/entrypoint.sh"]
|
7
docker/entrypoint.sh
Normal file
7
docker/entrypoint.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
DEFAULT_CRON="9 */6 * * *"
|
||||
cron=${cron:-$DEFAULT_CRON}
|
||||
set -e
|
||||
echo "$cron /usr/bin/php /IYUU/iyuu.php" | crontab -
|
||||
/usr/bin/php /IYUU/iyuu.php
|
||||
/usr/sbin/crond -f
|
Loading…
x
Reference in New Issue
Block a user