upgrade to PHP 8.2
This commit is contained in:
parent
3e380f2a41
commit
4e66fbe35e
3 changed files with 16 additions and 16 deletions
24
Dockerfile
24
Dockerfile
|
@ -1,6 +1,6 @@
|
|||
FROM alpine:3.18.0
|
||||
|
||||
ARG ALPINE_PACKAGES="php81-iconv php81-pdo_mysql php81-pdo_pgsql php81-openssl php81-simplexml"
|
||||
ARG ALPINE_PACKAGES="php82-iconv php82-pdo_mysql php82-pdo_pgsql php82-openssl php82-simplexml"
|
||||
ARG COMPOSER_PACKAGES="aws/aws-sdk-php google/cloud-storage"
|
||||
ARG PBURL=https://github.com/PrivateBin/PrivateBin/
|
||||
ARG RELEASE=1.5.1
|
||||
|
@ -22,22 +22,23 @@ RUN \
|
|||
ALPINE_PACKAGES="$(echo ${ALPINE_PACKAGES} | sed 's/,/ /g')" ;\
|
||||
ALPINE_COMPOSER_PACKAGES="" ;\
|
||||
if [ -n "${COMPOSER_PACKAGES}" ] ; then \
|
||||
ALPINE_COMPOSER_PACKAGES="php81-phar" ;\
|
||||
if [ -n "${ALPINE_PACKAGES##*php81-curl*}" ] ; then \
|
||||
ALPINE_COMPOSER_PACKAGES="php81-curl ${ALPINE_COMPOSER_PACKAGES}" ;\
|
||||
ALPINE_COMPOSER_PACKAGES="php82-phar" ;\
|
||||
if [ -n "${ALPINE_PACKAGES##*php82-curl*}" ] ; then \
|
||||
ALPINE_COMPOSER_PACKAGES="php82-curl ${ALPINE_COMPOSER_PACKAGES}" ;\
|
||||
fi ;\
|
||||
if [ -n "${ALPINE_PACKAGES##*php81-mbstring*}" ] ; then \
|
||||
ALPINE_COMPOSER_PACKAGES="php81-mbstring ${ALPINE_COMPOSER_PACKAGES}" ;\
|
||||
if [ -n "${ALPINE_PACKAGES##*php82-mbstring*}" ] ; then \
|
||||
ALPINE_COMPOSER_PACKAGES="php82-mbstring ${ALPINE_COMPOSER_PACKAGES}" ;\
|
||||
fi ;\
|
||||
RAWURL="$(echo ${PBURL} | sed s/github.com/raw.githubusercontent.com/)" ;\
|
||||
fi \
|
||||
# Install dependencies
|
||||
&& apk upgrade --no-cache \
|
||||
&& apk add --no-cache gnupg git nginx php81 php81-fpm php81-gd php81-opcache \
|
||||
&& apk add --no-cache gnupg git nginx php82 php82-fpm php82-gd php82-opcache \
|
||||
s6 tzdata ${ALPINE_PACKAGES} ${ALPINE_COMPOSER_PACKAGES} \
|
||||
# Stabilize php config location
|
||||
&& mv /etc/php81 /etc/php \
|
||||
&& ln -s /etc/php /etc/php81 \
|
||||
&& mv /etc/php82 /etc/php \
|
||||
&& ln -s /etc/php /etc/php82 \
|
||||
&& ln -s $(which php82) /usr/local/bin/php \
|
||||
# Remove (some of the) default nginx & php config
|
||||
&& rm -f /etc/nginx.conf /etc/nginx/http.d/default.conf /etc/php/php-fpm.d/www.conf \
|
||||
&& rm -rf /etc/nginx/sites-* \
|
||||
|
@ -61,7 +62,6 @@ RUN \
|
|||
fi \
|
||||
&& if [ -n "${COMPOSER_PACKAGES}" ] ; then \
|
||||
wget -qO composer-installer.php https://getcomposer.org/installer \
|
||||
&& ln -s $(which php81) /usr/local/bin/php \
|
||||
&& php composer-installer.php --install-dir=/usr/local/bin --filename=composer ;\
|
||||
fi \
|
||||
&& cd /var/www \
|
||||
|
@ -79,10 +79,10 @@ RUN \
|
|||
&& mkdir -p /srv/data \
|
||||
&& sed -i "s#define('PATH', '');#define('PATH', '/srv/');#" index.php \
|
||||
# Support running s6 under a non-root user
|
||||
&& mkdir -p /etc/s6/services/nginx/supervise /etc/s6/services/php-fpm81/supervise \
|
||||
&& mkdir -p /etc/s6/services/nginx/supervise /etc/s6/services/php-fpm82/supervise \
|
||||
&& mkfifo \
|
||||
/etc/s6/services/nginx/supervise/control \
|
||||
/etc/s6/services/php-fpm81/supervise/control \
|
||||
/etc/s6/services/php-fpm82/supervise/control \
|
||||
&& chown -R ${UID}:${GID} /etc/s6 /run /srv/* /var/lib/nginx /var/www \
|
||||
&& chmod o+rwx /run /var/lib/nginx /var/lib/nginx/tmp \
|
||||
# Clean up
|
||||
|
|
|
@ -52,13 +52,13 @@ main() {
|
|||
BUILD_ARGS="--build-arg ALPINE_PACKAGES= --build-arg COMPOSER_PACKAGES="
|
||||
;;
|
||||
gcs)
|
||||
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php81-openssl --build-arg COMPOSER_PACKAGES=google/cloud-storage"
|
||||
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php82-openssl --build-arg COMPOSER_PACKAGES=google/cloud-storage"
|
||||
;;
|
||||
pdo)
|
||||
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php81-pdo_mysql,php81-pdo_pgsql --build-arg COMPOSER_PACKAGES="
|
||||
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php82-pdo_mysql,php82-pdo_pgsql --build-arg COMPOSER_PACKAGES="
|
||||
;;
|
||||
s3)
|
||||
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php81-curl,php81-mbstring,php81-openssl,php81-simplexml --build-arg COMPOSER_PACKAGES=aws/aws-sdk-php"
|
||||
BUILD_ARGS="--build-arg ALPINE_PACKAGES=php82-curl,php82-mbstring,php82-openssl,php82-simplexml --build-arg COMPOSER_PACKAGES=aws/aws-sdk-php"
|
||||
;;
|
||||
*)
|
||||
BUILD_ARGS=""
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#!/bin/execlineb -P
|
||||
/usr/sbin/php-fpm81
|
||||
/usr/sbin/php-fpm82
|
Loading…
Add table
Add a link
Reference in a new issue