Skip to content

Commit c5da047

Browse files
authored
[php-unit] Update nginx unit to 1.27 and php 8.1 (#7387)
* [php-unit] Update nginx unit to 1.27 and php 8.1 * Clean dockerfile
1 parent 63d15aa commit c5da047

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

frameworks/PHP/php/benchmark_config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"database": "MySQL",
105105
"framework": "PHP",
106106
"language": "PHP",
107-
"flavor": "PHP7",
107+
"flavor": "PHP8.1",
108108
"orm": "Raw",
109109
"platform": "Unit Nginx",
110110
"webserver": "None",

frameworks/PHP/php/deploy/nginx-unit.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
"applications": {
99
"benchmark": {
10-
"type": "php 7",
10+
"type": "php",
1111
"processes": 84,
1212
"user": "www-data",
1313
"group": "www-data",
+6-22
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
1-
FROM ubuntu:20.04
1+
FROM nginx/unit:1.27.0-php8.1
22

3-
ARG DEBIAN_FRONTEND=noninteractive
4-
5-
RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
6-
#RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
7-
RUN apt-get update -yqq > /dev/null && \
8-
apt-get install -yqq curl php-mysql > /dev/null
9-
10-
RUN curl https://nginx.org/keys/nginx_signing.key | apt-key add - \
11-
&& add-apt-repository "deb https://packages.nginx.org/unit/ubuntu/ focal unit" -s \
12-
&& apt-get -y update \
13-
&& apt-get -y install unit unit-php
14-
15-
ADD ./ /php
3+
ADD . /php
164
WORKDIR /php
175

18-
# forward log to docker log collector
19-
#RUN ln -sf /dev/stdout /var/log/unit.log
20-
21-
# RUN if [ $(nproc) = 2 ]; then sed -i "s|\"processes\": 128,|\"processes\": 64,|g" /php/deploy/nginx-unit.json ; fi;
6+
RUN docker-php-ext-install pdo_mysql opcache > /dev/null
7+
RUN if [ $(nproc) = 2 ]; then sed -i "s|\"processes\": 84,|\"processes\": 64,|g" /php/deploy/nginx-unit.json ; fi;
228

23-
RUN unitd && \
24-
curl -X PUT --data-binary @/php/deploy/nginx-unit.json --unix-socket \
25-
/var/run/control.unit.sock http://localhost/config
9+
COPY deploy/nginx-unit.json /docker-entrypoint.d/nginx-unit.json
2610

2711
EXPOSE 8080
2812

29-
CMD unitd --no-daemon
13+
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]

0 commit comments

Comments
 (0)