1
0
Fork 0
mirror of synced 2024-06-01 10:29:48 +12:00

Upgraded PHP version from 7.2 to 7.3

This commit is contained in:
eldadfux 2019-07-29 07:49:31 +03:00
parent f9763f835e
commit 6693b13e77
3 changed files with 13 additions and 13 deletions

View file

@ -9,7 +9,7 @@ RUN \
apt-get install -y software-properties-common && \
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && \
apt-get update --fix-missing && \
apt-get install -y htop supervisor openssl wget php7.2 php7.2-fpm php7.2-mysqlnd php7.2-curl php7.2-imagick php7.2-mbstring php7.2-dom php7.2-dev webp && \
apt-get install -y htop supervisor openssl wget php7.3 php7.3-fpm php7.3-mysqlnd php7.3-curl php7.3-imagick php7.3-mbstring php7.3-dom php7.3-dev webp && \
# nginx
echo "deb http://nginx.org/packages/mainline/ubuntu/ wily nginx" >> /etc/apt/sources.list.d/nginx.list && \
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ wily nginx" >> /etc/apt/sources.list.d/nginx.list && \
@ -21,22 +21,22 @@ RUN \
wget -q https://github.com/phpredis/phpredis/archive/3.1.2.tar.gz && \
tar -xf 3.1.2.tar.gz && \
cd phpredis-3.1.2 && \
phpize7.2 && \
phpize7.3 && \
./configure && \
make && make install && \
echo extension=redis.so >> /etc/php/7.2/fpm/conf.d/redis.ini && \
echo extension=redis.so >> /etc/php/7.2/cli/conf.d/redis.ini && \
echo extension=redis.so >> /etc/php/7.3/fpm/conf.d/redis.ini && \
echo extension=redis.so >> /etc/php/7.3/cli/conf.d/redis.ini && \
# cleanup
cd ../ && \
rm -rf phpredis-3.1.2 && \
rm -rf 3.1.2.tar.gz && \
apt-get purge -y --auto-remove php7.2-dev && \
apt-get purge -y --auto-remove php7.3-dev && \
apt-get purge -y --auto-remove software-properties-common && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set upload limit
RUN echo "upload_max_filesize = 4M" > /etc/php/7.2/fpm/conf.d/appwrite.ini
RUN echo "upload_max_filesize = 4M" > /etc/php/7.3/fpm/conf.d/appwrite.ini
# nginx conf (with ssl certificates)
ADD ./docker/nginx.conf /etc/nginx/nginx.conf
@ -44,7 +44,7 @@ ADD ./docker/ssl/nginx.crt /etc/nginx/ssl/nginx.crt
ADD ./docker/ssl/nginx.key /etc/nginx/ssl/nginx.key
# php conf
ADD ./docker/www.conf /etc/php/7.2/fpm/pool.d/www.conf
ADD ./docker/www.conf /etc/php/7.3/fpm/pool.d/www.conf
# supervisord conf
ADD ./docker/supervisord.conf /etc/supervisord.conf

View file

@ -10,12 +10,12 @@ function setEnvironmentVariable() {
fi
# Check whether variable already exists
if grep -q $1 /etc/php/7.2/fpm/pool.d/www.conf; then
if grep -q $1 /etc/php/7.3/fpm/pool.d/www.conf; then
# Reset variable
sed -i "s/^env\[$1.*/env[$1] = $2/g" /etc/php/7.2/fpm/pool.d/www.conf
sed -i "s/^env\[$1.*/env[$1] = $2/g" /etc/php/7.3/fpm/pool.d/www.conf
else
# Add variable
echo "env[$1] = $2" >> /etc/php/7.2/fpm/pool.d/www.conf
echo "env[$1] = $2" >> /etc/php/7.3/fpm/pool.d/www.conf
fi
}
@ -26,8 +26,8 @@ for _curVar in `env | grep _APP_ | awk -F = '{print $1}'`;do
setEnvironmentVariable ${_curVar} ${!_curVar}
done
echo newrelic.license = \"$_APP_NEWRELIC_KEY\" > /etc/php/7.2/fpm/conf.d/newrelic.ini
echo newrelic.license = \"$_APP_NEWRELIC_KEY\" > /etc/php/7.2/cli/conf.d/newrelic.ini
echo newrelic.license = \"$_APP_NEWRELIC_KEY\" > /etc/php/7.3/fpm/conf.d/newrelic.ini
echo newrelic.license = \"$_APP_NEWRELIC_KEY\" > /etc/php/7.3/cli/conf.d/newrelic.ini
# Start supervisord and services
/usr/bin/supervisord -n -c /etc/supervisord.conf

View file

@ -22,7 +22,7 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
[program:php7-fpm]
command=service php7.2-fpm start
command=service php7.3-fpm start
autostart=true
autorestart=true
priority=5