Explorar o código

换用debian:stable-slim为基版,降级到php7.3-fpm

hongwenjun %!s(int64=3) %!d(string=hai) anos
pai
achega
01e743c23a
Modificáronse 4 ficheiros con 18 adicións e 22 borrados
  1. 6 7
      Dockerfile
  2. 8 8
      README.md
  3. 1 3
      default
  4. 3 4
      supervisord.conf

+ 6 - 7
Dockerfile

@@ -1,9 +1,9 @@
-FROM debian:unstable-slim
+FROM debian:stable-slim
 RUN  apt update -y && \
      apt install -y --no-install-recommends --no-install-suggests nginx supervisor wget  \
-     php7.4 php7.4-fpm php7.4-sqlite3 php7.4-xml php7.4-zip php7.4-pgsql php7.4-mbstring  \
-     php7.4-bcmath php7.4-json php7.4-mysql php7.4-gd php7.4-cli php7.4-curl php7.4-cgi && \
-     mkdir -p  /var/run/php  /run/php  && \
+     php7.3 php7.3-fpm php7.3-sqlite3 php7.3-xml php7.3-zip php7.3-pgsql php7.3-mbstring  \
+     php7.3-bcmath php7.3-json php7.3-mysql php7.3-gd php7.3-cli php7.3-curl php7.3-cgi && \
+     mkdir -p  /var/run/php  /run/php  /etc/nginx/cert && \
      wget https://raw.githubusercontent.com/hongwenjun/nginx-php/main/start.sh         --no-check-certificate && \
      wget https://raw.githubusercontent.com/hongwenjun/nginx-php/main/default          --no-check-certificate  && \
      wget https://raw.githubusercontent.com/hongwenjun/nginx-php/main/supervisord.conf --no-check-certificate   && \
@@ -13,10 +13,10 @@ RUN  apt update -y && \
      ln -sf /dev/stdout /var/log/nginx/access.log  && \
      ln -sf /dev/stderr /var/log/nginx/error.log   && \
      echo "<?php phpinfo(); ?>"  > /var/www/html/index.php && \
-     apt remove -y wget && \     
+     apt remove -y wget && \
      rm -rf /var/lib/apt/lists/*   /var/cache/apt
 
-VOLUME [/var/www/html  /etc/nginx/sites-enabled ]
+VOLUME [/var/www/html  /etc/nginx/conf.d  /etc/nginx/cert]
 EXPOSE 80/tcp  443/tcp
 
 # COPY ./default             /etc/nginx/sites-enabled/default
@@ -25,4 +25,3 @@ EXPOSE 80/tcp  443/tcp
 
 CMD ["/start.sh"]
 
-

+ 8 - 8
README.md

@@ -1,8 +1,8 @@
 ![](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/nginx-banner.png)
-## 基于 debian:unstable-slim 配置 Docker 容器  nginx-php-fpm7.4 镜像
+## 基于 debian:stable-slim 配置 Docker 容器  nginx-php-fpm7.3 镜像
 
 ```
-# 下载 nginx-php7.4-fpm 项目源码
+# 下载 nginx-php7.3-fpm 项目源码
 git clone https://github.com/hongwenjun/nginx-php.git
 
 cd nginx-php
@@ -10,7 +10,7 @@ cd nginx-php
 # Docker 编译 Dockerfile
 docker build -t nginx-php .
 
-# 测试启动 nginx-php7.4-fpm 容器
+# 测试启动 nginx-php7.3-fpm 容器
 docker run -d -p 8888:80 --name  nginx-php  nginx-php
 
 # 进入容器
@@ -33,7 +33,7 @@ docker push hongwenjun/nginx-php
 
 ```
 
-### 启动 nginx-php-fpm7.4 容器
+### 启动 nginx-php-fpm7.3 容器
 
 ```
 docker run -d -p 80:80 -p 443:443  \
@@ -48,10 +48,10 @@ docker run -d -p 80:80 -p 443:443  \
 ```
 FROM debian:unstable-slim
 
-#  安装 nginx supervisor php7.4-fpm 省略 ......
+#  安装 nginx supervisor php7.3-fpm 省略 ......
 
 #  映射目录和端口和三个配置文件
-VOLUME [/var/www/html  /etc/nginx/sites-enabled ]
+VOLUME [/var/www/html  /etc/nginx/conf.d  /etc/nginx/cert]
 EXPOSE 80/tcp  443/tcp
 
 # COPY ./default             /etc/nginx/sites-enabled/default
@@ -86,7 +86,7 @@ server {
         location ~ .*\.php(\/.*)*$ {
                 include snippets/fastcgi-php.conf;
         #       # With php-fpm (or other unix sockets):
-                fastcgi_pass unix:/run/php/php7.4-fpm.sock;
+                fastcgi_pass unix:/run/php/php7.3-fpm.sock;
         }
 
 }
@@ -96,7 +96,7 @@ server {
 
 ### docker-compose (recommended)
 
-```  
+```
 ---
 version: "2.1"
 services:

+ 1 - 3
default

@@ -1,5 +1,3 @@
-#   /etc/nginx/sites-enabled/default
-
 ##
 # You should look at the following URL's in order to grasp a solid understanding
 # of Nginx configuration files in order to fully unleash the power of Nginx.
@@ -59,7 +57,7 @@ server {
                 include snippets/fastcgi-php.conf;
         #
         #       # With php-fpm (or other unix sockets):
-                fastcgi_pass unix:/run/php/php7.4-fpm.sock;
+                fastcgi_pass unix:/run/php/php7.3-fpm.sock;
         #       # With php-cgi (or other tcp sockets):
         #       fastcgi_pass 127.0.0.1:9000;
         }

+ 3 - 4
supervisord.conf

@@ -22,7 +22,7 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
 serverurl=unix:///dev/shm/supervisor.sock ; use a unix:// URL  for a unix socket
 
 [program:php-fpm]
-command = php-fpm7.4 --force-stderr --nodaemonize --fpm-config  /etc/php/7.4/fpm/php-fpm.conf
+command = php-fpm7.3 --force-stderr --nodaemonize --fpm-config  /etc/php/7.3/fpm/php-fpm.conf
 autostart=true
 autorestart=true
 priority=5
@@ -47,6 +47,5 @@ stderr_logfile=/dev/stderr
 stderr_logfile_maxbytes=0
 stopsignal=QUIT
 
-[include]
-files = /etc/supervisor/conf.d/*.conf
-
+;[include]
+;files = /etc/supervisor/conf.d/*.conf