Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating base image version for php73 #26

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
28 changes: 18 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions build/default
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion build/phpfpm.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

php5-fpm -c /etc/php5/fpm
php-fpm7.3