diff --git a/Dockerfile b/Dockerfile index ad62595..1e189ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM phusion/baseimage:0.9.15 +FROM phusion/baseimage:0.11 + +RUN ls / # Ensure UTF-8 RUN locale-gen en_US.UTF-8 @@ -13,22 +15,28 @@ CMD ["/sbin/my_init"] # Nginx-PHP Installation RUN apt-get update -RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y vim curl wget build-essential python-software-properties -RUN add-apt-repository -y ppa:ondrej/php5 +RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y vim curl wget build-essential software-properties-common +RUN add-apt-repository -y ppa:ondrej/php RUN add-apt-repository -y ppa:nginx/stable RUN apt-get update -RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y --force-yes php5-cli php5-fpm php5-mysql php5-pgsql php5-sqlite php5-curl\ - php5-gd php5-mcrypt php5-intl php5-imap php5-tidy -RUN sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php5/fpm/php.ini -RUN sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php5/cli/php.ini +RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y php7.3-cli php7.3-fpm php7.3-mysql php7.3-curl\ + php7.3-gd php7.3-intl php7.3-imap php7.3-tidy php7.3-memcache \ + php7.3-redis php7.3-mbstring php7.3-dom + +RUN phpenmod mcrypt RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y nginx RUN echo "daemon off;" >> /etc/nginx/nginx.conf -RUN sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf -RUN sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php5/fpm/php.ini - +RUN mkdir /run/php + +RUN sed -i "/;clear_env = .*/c\clear_env = no" /etc/php/7.3/fpm/pool.d/www.conf \ + && sed -i "/;catch_workers_output = .*/c\catch_workers_output = yes" /etc/php/7.3/fpm/pool.d/www.conf \ + && sed -i "/pid = .*/c\;pid = /run/php/php7.3-fpm.pid" /etc/php/7.3/fpm/php-fpm.conf \ + && sed -i "/;daemonize = .*/c\daemonize = no" /etc/php/7.3/fpm/php-fpm.conf \ + && sed -i "/session\.cache_limiter = .*/c\session.cache_limiter = " /etc/php/7.3/fpm/php.ini + RUN mkdir -p /var/www ADD build/default /etc/nginx/sites-available/default RUN mkdir /etc/service/nginx diff --git a/build/default b/build/default index d86e728..8bf2e79 100644 --- a/build/default +++ b/build/default @@ -21,13 +21,13 @@ server { error_page 404 /index.php; - # pass the PHP scripts to php5-fpm + # pass the PHP scripts to php7-fpm # Note: \.php$ is susceptible to file upload attacks # Consider using: "location ~ ^/(index|app|app_dev|config)\.php(/|$) {" location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; - # With php5-fpm: - fastcgi_pass unix:/var/run/php5-fpm.sock; + # With php7-fpm: + fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; fastcgi_index index.php; include fastcgi_params; include fastcgi.conf; diff --git a/build/phpfpm.sh b/build/phpfpm.sh index bb5d63d..eb98ed3 100755 --- a/build/phpfpm.sh +++ b/build/phpfpm.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -php5-fpm -c /etc/php5/fpm +php-fpm7.3