Browse Source

dockerfile for latest and samba improved

master
filesite 2 years ago
parent
commit
c6c8a7b288
  1. 21
      Dockerfile
  2. 6
      Dockerfile_samba
  3. 19
      bin/upgrade.sh

21
Dockerfile

@ -1,6 +1,5 @@ @@ -1,6 +1,5 @@
FROM php:8.1.12RC1-fpm-alpine3.16
RUN apk add \
nginx zlib-dev libpng-dev freetype-dev libjpeg-turbo-dev \
RUN apk add rsync nginx zlib-dev libpng-dev freetype-dev libjpeg-turbo-dev \
&& 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 \
@ -9,14 +8,13 @@ RUN apk add \ @@ -9,14 +8,13 @@ RUN apk add \
&& tar -zxvf master.tar.gz \
&& rm -f 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/ \
&& cd machete/ \
&& chown apache:apache runtime/ \
&& chown -R apache:apache www/content/ \
&& chown apache:apache www/navs/ \
&& chown apache:apache www/girls/ \
&& chown apache:apache www/videos/ \
&& cd /var/www/machete/ \
&& mkdir www/navs/ && mkdir www/girls/ && mkdir www/videos/ \
&& chown www-data:www-data runtime/ \
&& chown -R www-data:www-data www/content/ \
&& chown www-data:www-data www/navs/ \
&& chown www-data:www-data www/girls/ \
&& chown www-data:www-data www/videos/ \
&& cd /var/www/downloads/ \
&& wget "https://git.filesite.io/wen/jialuomaadmin/archive/master.tar.gz" \
&& tar -zxvf master.tar.gz \
@ -24,7 +22,8 @@ RUN apk add \ @@ -24,7 +22,8 @@ RUN apk add \
&& rm -rf /var/www/machete/www/admin/ \
&& mv jialuomaadmin/dist/ /var/www/machete/www/admin \
&& rm -f /etc/nginx/http.d/default.conf \
&& cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/http.d/machete.conf
&& cp /var/www/machete/conf/nginx_machete.conf /etc/nginx/http.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"]

6
Dockerfile_samba

@ -14,9 +14,8 @@ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n @@ -14,9 +14,8 @@ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n
&& tar -zxvf master.tar.gz \
&& rm -f 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/ \
&& cd machete/ \
&& cd /var/www/machete/ \
&& mkdir www/navs/ && mkdir www/girls/ && mkdir www/videos/ \
&& chown apache:apache runtime/ \
&& chown -R apache:apache www/content/ \
&& chown apache:apache www/navs/ \
@ -55,6 +54,7 @@ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n @@ -55,6 +54,7 @@ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n
&& echo 'LANG="zh_CN.UTF-8"' >> /etc/locale.conf \
&& echo 'export LC_ALL="zh_CN.UTF-8"' >> ~/.bashrc
EXPOSE 9000/tcp
EXPOSE 80/tcp
EXPOSE 445/tcp
ENTRYPOINT ["/var/www/machete/docker-entrypoint.sh"]

19
bin/upgrade.sh

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
echo "Upgrade machete ..."
echo ""
mkdir -p /var/www/downloads
cd /var/www/downloads/
rm -f master.tar.gz
@ -15,12 +16,20 @@ rsync -vruL machete/* /var/www/machete/ \ @@ -15,12 +16,20 @@ rsync -vruL machete/* /var/www/machete/ \
--exclude=www/girls/ \
--exclude=www/videos/ \
--exclude=runtime/
# check the user of php-fpm
phpUser='apache'
isAlpine=`grep 'www-data' /etc/passwd | wc -l`
if [ $isAlpine -ge 1 ]; then
phpUser='www-data'
fi
cd /var/www/machete/ \
&& chown apache:apache runtime/ \
&& chown -R apache:apache www/content/ \
&& chown apache:apache www/navs/ \
&& chown apache:apache www/girls/ \
&& chown apache:apache www/videos/
&& chown "${phpUser}:${phpUser}" runtime/ \
&& chown -R "${phpUser}:${phpUser}" www/content/ \
&& chown "${phpUser}:${phpUser}" www/navs/ \
&& chown "${phpUser}:${phpUser}" www/girls/ \
&& chown "${phpUser}:${phpUser}" www/videos/
# upgrade admin

Loading…
Cancel
Save