Browse Source

Add php-ngx with pgsql (#5106)

Joan Miquel 5 years ago
parent
commit
a56976f60b

+ 1 - 1
frameworks/PHP/php-ngx/README.md

@@ -9,7 +9,7 @@ ngx_php7 draws on the design of ngx_lua and is committed to providing non-blocki
 
 
 ## Infrastructure Software Versions
-The tests were run with [PHP Version 7.3.*](https://www.php.net/) + OPcache
+The tests were run with [PHP Version 7.3.*](https://www.php.net/) without OPcache
 
 ### Platform
 

+ 21 - 0
frameworks/PHP/php-ngx/benchmark_config.json

@@ -23,6 +23,27 @@
       "display_name": "PHP-raw-ngx",
       "notes": "ngx_php",
       "versus": "php"
+    },
+    "pgsql": {
+      "db_url": "/db",
+      "query_url": "/query?queries=",
+      "fortune_url": "/fortune",
+      "update_url": "/update?queries=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "Postgres",
+      "framework": "None",
+      "language": "PHP",
+      "flavor": "PHP7",
+      "orm": "Raw",
+      "platform": "ngx_php",
+      "webserver": "nginx",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "PHP-raw-ngx-Postgres",
+      "notes": "ngx_php Postgres",
+      "versus": "php"
     }
   }]
 }

+ 0 - 0
frameworks/PHP/php-ngx/deploy/nginx_php.conf → frameworks/PHP/php-ngx/deploy/nginx.conf


+ 33 - 0
frameworks/PHP/php-ngx/php-ngx-pgsql.dockerfile

@@ -0,0 +1,33 @@
+FROM ubuntu:19.04
+
+ARG DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
+RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null
+RUN apt-get update -yqq > /dev/null && \
+    apt-get install -yqq wget git unzip libxml2-dev cmake make systemtap-sdt-dev \
+                    zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev libargon2-0-dev libsodium-dev \
+                    php7.3 php7.3-common php7.3-dev libphp7.3-embed php7.3-pgsql nginx > /dev/null
+
+ADD ./ ./
+
+ENV NGINX_VERSION=1.17.3
+
+RUN git clone -b v0.0.19 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
+
+RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
+    tar -zxf nginx-${NGINX_VERSION}.tar.gz && \
+    cd nginx-${NGINX_VERSION} && \
+    export PHP_LIB=/usr/lib && \ 
+    ./configure --user=www --group=www \
+            --prefix=/nginx \
+            --with-ld-opt="-Wl,-rpath,$PHP_LIB" \
+            --add-module=/ngx_php7/third_party/ngx_devel_kit \
+            --add-module=/ngx_php7 > /dev/null && \
+    make > /dev/null && make install > /dev/null
+
+RUN sed -i "s|mysql:|pgsql:|g" /deploy/nginx.conf
+
+CMD /nginx/sbin/nginx -c /deploy/nginx.conf
+
+

+ 1 - 1
frameworks/PHP/php-ngx/php-ngx.dockerfile

@@ -26,6 +26,6 @@ RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
             --add-module=/ngx_php7 > /dev/null && \
     make > /dev/null && make install > /dev/null
 
-CMD /nginx/sbin/nginx -c /deploy/nginx_php.conf
+CMD /nginx/sbin/nginx -c /deploy/nginx.conf