diff --git a/docker/AMD64/Dockerfile b/docker/AMD64/Dockerfile new file mode 100644 index 0000000..cc9eb40 --- /dev/null +++ b/docker/AMD64/Dockerfile @@ -0,0 +1,104 @@ +FROM swoft/alphp:base +#FROM arm64v8/alpine:latest +#FROM arm64v8/alpine:3.12 +LABEL maintainer="david <367013672@qq.com>" version="1.0" + +## +# ---------- env settings ---------- +## + +# --build-arg timezone=Asia/Shanghai +ARG timezone +# prod pre test dev +ARG app_env=prod +# default use www-data user +# ARG add_user=www-data + +ENV APP_ENV=${app_env:-"prod"} \ + TIMEZONE=${timezone:-"Asia/Shanghai"} + +## +# ---------- building ---------- +## + +RUN set -ex \ + # change apk source repo + && 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') + # ca-certificates \ + # curl \ + # tar \ + # xz \ + # libressl \ + # openssh \ + # openssl \ + git \ + tzdata \ + # pcre \ + # install php7 and some extensions + php7 \ + # php7-common \ + # php7-bcmath \ + php7-curl \ + # php7-ctype \ + php7-dom \ + # php7-fileinfo \ + # php7-gettext \ + # php7-gd \ + # php7-iconv \ + # php7-imagick \ + php7-json \ + php7-mbstring \ + #php7-mongodb \ + # php7-mysqlnd \ + # php7-openssl \ + # php7-opcache \ + # php7-pdo \ + # php7-pdo_mysql \ + # php7-pdo_sqlite \ + # php7-phar \ + # php7-posix \ + # php7-redis \ + php7-simplexml \ + # php7-sockets \ + # php7-sodium \ + # php7-sqlite \ + # php7-session \ + # php7-sysvshm \ + # php7-sysvmsg \ + # php7-sysvsem \ + # 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 \ + && apk del --purge *-dev \ + && rm -rf /var/cache/apk/* /tmp/* /usr/share/man /usr/share/php7 \ + # ---------- some config,clear work ---------- + && cd /etc/php7 \ + # - config PHP + && { \ + echo "upload_max_filesize=100M"; \ + echo "post_max_size=108M"; \ + echo "memory_limit=1024M"; \ + echo "date.timezone=${TIMEZONE}"; \ + } | tee conf.d/99-overrides.ini \ + # - config timezone + && ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \ + && echo "${TIMEZONE}" > /etc/timezone \ + # ---------- 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} \ + # && adduser -u 82 -D -S -G ${add_user} ${add_user} \ + # # - create user dir + # && mkdir -p /data \ + # && chown -R ${add_user}:${add_user} /data \ + && echo -e "\033[42;37m Build Completed :).\033[0m\n" + +EXPOSE 9000 +# VOLUME ["/var/www", "/data"] +WORKDIR /var/www diff --git a/docker/AMD64/build.sh b/docker/AMD64/build.sh new file mode 100644 index 0000000..e3ad79c --- /dev/null +++ b/docker/AMD64/build.sh @@ -0,0 +1,4 @@ +#!/bin/sh +docker build -t iyuu:latest . +docker run -it -v /root/config.php:/config.php --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest +docker exec -it IYUUAutoReseed php iyuu.php \ No newline at end of file diff --git a/docker/Arm64v8/Dockerfile b/docker/Arm64v8/Dockerfile index 55d3cb7..7033c15 100644 --- a/docker/Arm64v8/Dockerfile +++ b/docker/Arm64v8/Dockerfile @@ -1,16 +1,21 @@ -#FROM alpine:latest FROM arm64v8/alpine - +#FROM arm64v8/alpine:latest +#FROM arm64v8/alpine:3.12 +ENV TZ Asia/Shanghai +ENV cron="0 9 * * 0" RUN set -ex \ && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/' /etc/apk/repositories \ - && apk --update add --no-cache tzdata php7 php7-curl php7-json php7-mbstring git \ + # && sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.cn/' /etc/apk/repositories \ + && apk --update add --no-cache \ + tzdata \ + php7 php7-curl php7-json php7-mbstring php7-dom php7-simplexml php7-xml php7-zip \ + git \ && 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 - -ENV TZ Asia/Shanghai -ENV cron="0 9 * * 0" - + && ln -sf /IYUU/config/config.php /config.php \ + && echo "${TZ}" > /etc/timezone \ + && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime + WORKDIR /IYUU 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"] diff --git a/docker/Arm64v8/build.n1.sh b/docker/Arm64v8/build.n1.sh new file mode 100644 index 0000000..74f2e0e --- /dev/null +++ b/docker/Arm64v8/build.n1.sh @@ -0,0 +1,4 @@ +#!/bin/sh +docker build -t iyuu:latest . +docker run -it -v /root/config.php:/config.php -v /var/lib/transmission/torrents:/torrents -v /var/lib/qbittorrent/.local/share/data/qBittorrent/BT_backup:/BT_backup --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest +docker exec -it IYUUAutoReseed php iyuu.php \ No newline at end of file diff --git a/docker/Arm64v8/build.sh b/docker/Arm64v8/build.sh index 74f2e0e..29548e7 100644 --- a/docker/Arm64v8/build.sh +++ b/docker/Arm64v8/build.sh @@ -1,4 +1,4 @@ #!/bin/sh -docker build -t iyuu:latest . -docker run -it -v /root/config.php:/config.php -v /var/lib/transmission/torrents:/torrents -v /var/lib/qbittorrent/.local/share/data/qBittorrent/BT_backup:/BT_backup --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest +docker build -f Dockerfile -t iyuu:latest . +docker run -it -v /root/config.php:/config.php --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest docker exec -it IYUUAutoReseed php iyuu.php \ No newline at end of file diff --git a/docker/Arm64v8/iyuu.sh b/docker/Arm64v8/iyuu.sh index 358d045..9ebf943 100644 --- a/docker/Arm64v8/iyuu.sh +++ b/docker/Arm64v8/iyuu.sh @@ -1,3 +1,3 @@ #!/bin/sh export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin -docker exec -it IYUUAutoReseed php iyuu.php \ No newline at end of file +docker exec IYUUAutoReseed php iyuu.php \ No newline at end of file diff --git a/docker/Arm64v8/task.sh b/docker/Arm64v8/task.sh deleted file mode 100644 index 9ebf943..0000000 --- a/docker/Arm64v8/task.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin -docker exec IYUUAutoReseed php iyuu.php \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index becf86e..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM composer:1.10.9 - -ENV TZ Asia/Shanghai -ENV cron="0 */1 * * *" - -COPY . /IYUU -COPY ./docker/entrypoint.sh /entrypoint.sh - -WORKDIR /IYUU - -RUN apk add --no-cache bash tzdata \ - && composer i - -ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/docker/build.sh b/docker/build.sh deleted file mode 100644 index 051b04b..0000000 --- a/docker/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -cd /root -wget -c https://gitee.com/ledc/IYUUAutoReseed/repository/archive/master.zip -O IYUUAutoReseed.zip -unzip -o ./IYUUAutoReseed.zip -d /root -rm ./IYUUAutoReseed.zip -cd /root/IYUUAutoReseed/docker -chmod +x ./*.sh -docker build -t iyuu:latest . -docker run -it -v /root/IYUUAutoReseed:/IYUU -p 8510:9000 --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh deleted file mode 100755 index 9c87da8..0000000 --- a/docker/entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -DEFAULT_CRON="0 */1 * * *" -cron=${cron:-$DEFAULT_CRON} -set -e - -echo "$cron /usr/local/bin/php /IYUU/iyuu.php" | crontab - - -/usr/local/bin/php /IYUU/iyuu.php - -/usr/sbin/crond -f diff --git a/docker/iyuu.sh b/docker/iyuu.sh deleted file mode 100644 index 358d045..0000000 --- a/docker/iyuu.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin -docker exec -it IYUUAutoReseed php iyuu.php \ No newline at end of file diff --git a/docker/n1.sh b/docker/n1.sh deleted file mode 100644 index 8299ae8..0000000 --- a/docker/n1.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd /root -git clone https://gitee.com/ledc/IYUUAutoReseed.git -cd /root/IYUUAutoReseed/docker -chmod +x ./*.sh -docker build -t iyuu:latest . -docker run -it -v /root/IYUUAutoReseed:/IYUU -v /var/lib/qbittorrent/.local/share/data/qBittorrent/BT_backup:/BT_backup -p 8510:9000 --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest -./iyuu.sh \ No newline at end of file diff --git a/docker/task.sh b/docker/task.sh deleted file mode 100644 index 9ebf943..0000000 --- a/docker/task.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin -docker exec IYUUAutoReseed php iyuu.php \ No newline at end of file