[Why] H5ai need PHP dev
Signed-off-by: Lu Weitao luweitaobe@163.com --- container/srv-http/Dockerfile | 6 ++++++ container/srv-http/root/etc/nginx/conf.d/default.conf | 7 +++++++ container/srv-http/root/sbin/entrypoint.sh | 4 ++++ 3 files changed, 17 insertions(+) create mode 100755 container/srv-http/root/sbin/entrypoint.sh
diff --git a/container/srv-http/Dockerfile b/container/srv-http/Dockerfile index 8a3bdcb..2821e57 100644 --- a/container/srv-http/Dockerfile +++ b/container/srv-http/Dockerfile @@ -3,3 +3,9 @@
FROM nginx:alpine ADD root / + +RUN apk add --no-cache php7 php7-fpm php7-session php7-json php7-exif php7-imagick php7-gd php7-fileinfo + +RUN sed -i '/[global]/a daemonize = no' /etc/php7/php-fpm.conf + +ENTRYPOINT ["/sbin/entrypoint.sh"] diff --git a/container/srv-http/root/etc/nginx/conf.d/default.conf b/container/srv-http/root/etc/nginx/conf.d/default.conf index 91371f1..676418a 100644 --- a/container/srv-http/root/etc/nginx/conf.d/default.conf +++ b/container/srv-http/root/etc/nginx/conf.d/default.conf @@ -12,6 +12,13 @@ server { log_not_found off; }
+ location ~ .php$ { + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + location / { default_type text/html; autoindex on; diff --git a/container/srv-http/root/sbin/entrypoint.sh b/container/srv-http/root/sbin/entrypoint.sh new file mode 100755 index 0000000..cd73c7e --- /dev/null +++ b/container/srv-http/root/sbin/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +nginx +/usr/sbin/php-fpm7