From 80104e1a7f26bcbbebc06a9d4faaf55bb1a278c9 Mon Sep 17 00:00:00 2001 From: filesite Date: Sat, 5 Nov 2022 11:55:18 +0800 Subject: [PATCH] add install script for centos 7.9 --- Dockerfile_samba | 25 ++++++++++++++++++++++ bin/install.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ conf/nginx.conf | 33 +++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 Dockerfile_samba create mode 100755 bin/install.sh create mode 100644 conf/nginx.conf diff --git a/Dockerfile_samba b/Dockerfile_samba new file mode 100644 index 0000000..7a5a5e3 --- /dev/null +++ b/Dockerfile_samba @@ -0,0 +1,25 @@ +FROM centos:centos7.9.2009 + +RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ + && yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm \ + && 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 \ + && 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 + +EXPOSE 80/tcp +ENTRYPOINT ["/var/www/machete/docker-entrypoint.sh"] +# 默认使用导航站皮肤:manual +CMD ["manual"] \ No newline at end of file diff --git a/bin/install.sh b/bin/install.sh new file mode 100755 index 0000000..4694369 --- /dev/null +++ b/bin/install.sh @@ -0,0 +1,54 @@ +#!/bin/sh +echo "Install php82-fpm and nginx in centos 7.9" + +yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm +yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm +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 +yum -y install nginx + +ln -s /opt/remi/php82/root/usr/sbin/php-fpm /usr/sbin/php-fpm +php-fpm -v + +## show php82-fpm's path +echo "php82-php-fpm installed in" +rpm -ql php82-php-fpm-8.2.0~rc5-18.el7.remi + +## replace configs in php.ini +cd /etc/opt/remi/php82/ +sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 10M/g' php.ini + +## start php-fpm in background +#php-fpm -D + +## start php-fpm in foreground +#php-fpm -F + +## start nginx +#/usr/sbin/nginx + + +## php82-fpm's path +##/etc/logrotate.d/php82-php-fpm +##/etc/opt/remi/php82/php-fpm.conf +##/etc/opt/remi/php82/php-fpm.d +##/etc/opt/remi/php82/php-fpm.d/www.conf +##/etc/opt/remi/php82/sysconfig/php-fpm +##/etc/systemd/system/php82-php-fpm.service.d +##/opt/remi/php82/root/usr/sbin/php-fpm +##/opt/remi/php82/root/usr/share/doc/php82-php-fpm-8.2.0~rc5 +##/opt/remi/php82/root/usr/share/doc/php82-php-fpm-8.2.0~rc5/php-fpm.conf.default +##/opt/remi/php82/root/usr/share/doc/php82-php-fpm-8.2.0~rc5/www.conf.default +##/opt/remi/php82/root/usr/share/fpm +##/opt/remi/php82/root/usr/share/fpm/status.html +##/opt/remi/php82/root/usr/share/licenses/php82-php-fpm-8.2.0~rc5 +##/opt/remi/php82/root/usr/share/licenses/php82-php-fpm-8.2.0~rc5/fpm_LICENSE +##/opt/remi/php82/root/usr/share/man/man8/php-fpm.8.gz +##/usr/lib/systemd/system/php82-php-fpm.service +##/var/opt/remi/php82/lib/php/opcache +##/var/opt/remi/php82/lib/php/session +##/var/opt/remi/php82/lib/php/wsdlcache +##/var/opt/remi/php82/log/php-fpm +##/var/opt/remi/php82/run/php-fpm \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..46bf3c3 --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,33 @@ +user nginx; +worker_processes auto; +error_log /var/log/nginx/error.log; +pid /run/nginx.pid; + +# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. +include /usr/share/nginx/modules/*.conf; + +events { + worker_connections 1024; +} + +http { + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 4096; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + # Load modular configuration files from the /etc/nginx/conf.d directory. + # See http://nginx.org/en/docs/ngx_core_module.html#include + # for more information. + include /etc/nginx/conf.d/*.conf; +}