From 6cecab40f1af6d1eaabc4dafbb3f9dbb549e7e5a Mon Sep 17 00:00:00 2001 From: filesite Date: Sat, 5 Nov 2022 17:43:43 +0800 Subject: [PATCH] add upgrade script --- Dockerfile | 16 ++++++++-------- Dockerfile_samba | 21 +++++++++++---------- bin/install.sh | 1 + bin/upgrade.sh | 19 +++++++++++++++++++ 4 files changed, 39 insertions(+), 18 deletions(-) create mode 100755 bin/upgrade.sh diff --git a/Dockerfile b/Dockerfile index 050430f..88bc291 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,14 +4,14 @@ RUN apk add \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install -j$(nproc) gd \ && cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \ - && mkdir -p /var/www/downloads && cd /var/www/downloads/ && \ - wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" && \ - tar -zxvf master.tar.gz && \ - mv machete/ /var/www/ && \ - cd /var/www/ && rm -rf downloads/ && \ - mkdir machete/www/navs/ && mkdir machete/www/girls/ && mkdir machete/www/videos/ && \ - rm -f /etc/nginx/http.d/default.conf && \ - cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/http.d/machete.conf + && mkdir -p /var/www/downloads && cd /var/www/downloads/ \ + && wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" \ + && tar -zxvf master.tar.gz \ + && mv machete/ /var/www/ \ + && cd /var/www/ && rm -rf downloads/ \ + && mkdir machete/www/navs/ && mkdir machete/www/girls/ && mkdir machete/www/videos/ \ + && rm -f /etc/nginx/http.d/default.conf \ + && cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/http.d/machete.conf EXPOSE 80/tcp ENTRYPOINT ["/var/www/machete/docker-entrypoint.sh"] diff --git a/Dockerfile_samba b/Dockerfile_samba index 7a5a5e3..281dc18 100644 --- a/Dockerfile_samba +++ b/Dockerfile_samba @@ -5,19 +5,20 @@ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n && yum -y install yum-utils \ && yum-config-manager --disable 'remi-php*' \ && yum-config-manager --enable remi-safe \ - && yum -y install php82-php-fpm php82-php-gd php82-php-mbstring nginx \ + && yum -y install php82-php-fpm php82-php-gd php82-php-mbstring nginx wget rsync \ && ln -s /opt/remi/php82/root/usr/sbin/php-fpm /usr/sbin/php-fpm \ && cd /etc/opt/remi/php82/ \ && sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 10M/g' php.ini \ - && mkdir -p /var/www/downloads && cd /var/www/downloads/ && \ - wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" && \ - tar -zxvf master.tar.gz && \ - mv machete/ /var/www/ && \ - cd /var/www/ && rm -rf downloads/ && \ - mkdir machete/www/navs/ && mkdir machete/www/girls/ && mkdir machete/www/videos/ && \ - rm -f /etc/nginx/nginx.conf && \ - cp /var/www/machete/conf/nginx.conf /etc/nginx/nginx.conf \ - cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/conf.d/machete.conf + && mkdir -p /var/www/downloads && cd /var/www/downloads/ \ + && wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" \ + && tar -zxvf master.tar.gz \ + && mv machete/ /var/www/ \ + && cd /var/www/ && rm -rf downloads/ \ + && mkdir machete/www/navs/ && mkdir machete/www/girls/ && mkdir machete/www/videos/ \ + && rm -f /etc/nginx/nginx.conf \ + && cp /var/www/machete/conf/nginx.conf /etc/nginx/nginx.conf \ + && cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/conf.d/machete.conf \ + && ln -s /var/www/machete/bin/upgrade.sh /usr/bin/upgrade_machete EXPOSE 80/tcp ENTRYPOINT ["/var/www/machete/docker-entrypoint.sh"] diff --git a/bin/install.sh b/bin/install.sh index 4694369..5774a0e 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -8,6 +8,7 @@ yum-config-manager --disable 'remi-php*' yum-config-manager --enable remi-safe yum -y install php82-php-fpm php82-php-gd php82-php-mbstring yum -y install nginx +yum -y install wget ln -s /opt/remi/php82/root/usr/sbin/php-fpm /usr/sbin/php-fpm php-fpm -v diff --git a/bin/upgrade.sh b/bin/upgrade.sh new file mode 100755 index 0000000..c20ce75 --- /dev/null +++ b/bin/upgrade.sh @@ -0,0 +1,19 @@ +#!/bin/sh +echo "Upgrade machete ..." +echo "" + +mkdir -p /var/www/downloads +cd /var/www/downloads/ +rm -f master.tar.gz +rm -rf machete/ +wget "https://git.filesite.io/filesite/machete/archive/master.tar.gz" +tar -zxvf master.tar.gz +rsync -vruL machete/* /var/www/machete/ \ + --exclude=www/content/ \ + --exclude=www/navs/ \ + --exclude=www/girls/ \ + --exclude=www/videos/ \ + --exclude=runtime/ + +echo "Machete upgrade done." +echo "" \ No newline at end of file