Skip to content

Commit

Permalink
Merge pull request #297 from stickz/php82-upgrade
Browse files Browse the repository at this point in the history
Upgrade to Alpine 3.19
  • Loading branch information
crazy-max committed Dec 23, 2023
2 parents bbb3fbe + e7ee357 commit c016e04
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 32 deletions.
48 changes: 23 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ARG GEOIP2_PHPEXT_VERSION=1.3.1
ARG RUTORRENT_VERSION=e7c81203eff5d43f6f2757ba4b05573d22f11e35
ARG GEOIP2_RUTORRENT_VERSION=4ff2bde530bb8eef13af84e4413cedea97eda148

ARG ALPINE_VERSION=3.18
ARG ALPINE_VERSION=3.19
ARG ALPINE_S6_VERSION=${ALPINE_VERSION}-2.2.0.3

FROM --platform=${BUILDPLATFORM} alpine:${ALPINE_VERSION} AS src
Expand Down Expand Up @@ -92,8 +92,8 @@ RUN apk --update --no-cache add \
openssl-dev \
patch \
pcre-dev \
php81-dev \
php81-pear \
php82-dev \
php82-pear \
tar \
tree \
xz \
Expand Down Expand Up @@ -171,13 +171,13 @@ WORKDIR /usr/local/src/geoip2-phpext
COPY --from=src-geoip2-phpext /src .
RUN <<EOT
set -e
phpize81
phpize82
./configure
make
make install
EOT
RUN mkdir -p ${DIST_PATH}/usr/lib/php81/modules
RUN cp -f /usr/lib/php81/modules/geoip.so ${DIST_PATH}/usr/lib/php81/modules/
RUN mkdir -p ${DIST_PATH}/usr/lib/php82/modules
RUN cp -f /usr/lib/php82/modules/geoip.so ${DIST_PATH}/usr/lib/php82/modules/
RUN tree ${DIST_PATH}

FROM crazymax/alpine-s6:${ALPINE_S6_VERSION}
Expand Down Expand Up @@ -205,6 +205,7 @@ RUN apk --update --no-cache add \
brotli \
ca-certificates \
coreutils \
cppunit-dev \
dhclient \
ffmpeg \
findutils \
Expand All @@ -218,23 +219,20 @@ RUN apk --update --no-cache add \
nginx-mod-http-dav-ext \
nginx-mod-http-geoip2 \
openssl \
php81 \
php81-bcmath \
php81-cli \
php81-ctype \
php81-curl \
php81-dom \
php81-fpm \
php81-json \
php81-mbstring \
php81-openssl \
php81-phar \
php81-posix \
php81-session \
php81-sockets \
php81-xml \
php81-zip \
php81-zlib \
php82 \
php82-bcmath \
php82-ctype \
php82-curl \
php82-dom \
php82-fpm \
php82-mbstring \
php82-openssl \
php82-phar \
php82-posix \
php82-session \
php82-sockets \
php82-xml \
php82-zip \
python3 \
py3-pip \
shadow \
Expand All @@ -244,8 +242,8 @@ RUN apk --update --no-cache add \
unzip \
util-linux \
zip \
&& pip3 install --upgrade pip \
&& pip3 install cfscrape cloudscraper \
&& pip3 install --upgrade --break-system-packages pip \
&& pip3 install --break-system-packages cfscrape cloudscraper \
&& addgroup -g ${PGID} rtorrent \
&& adduser -D -H -u ${PUID} -G rtorrent -s /bin/sh rtorrent \
&& curl --version \
Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/cont-init.d/02-fix-perms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ chown -R rtorrent:rtorrent \
/var/cache/nginx \
/var/lib/nginx \
/var/log/nginx \
/var/log/php81 \
/var/log/php82 \
/var/run/nginx \
/var/run/php-fpm \
/var/run/rtorrent
10 changes: 5 additions & 5 deletions rootfs/etc/cont-init.d/03-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ echo "Setting PHP-FPM configuration..."
sed -e "s/@MEMORY_LIMIT@/$MEMORY_LIMIT/g" \
-e "s/@UPLOAD_MAX_SIZE@/$UPLOAD_MAX_SIZE/g" \
-e "s/@CLEAR_ENV@/$CLEAR_ENV/g" \
/tpls/etc/php81/php-fpm.d/www.conf > /etc/php81/php-fpm.d/www.conf
/tpls/etc/php82/php-fpm.d/www.conf > /etc/php82/php-fpm.d/www.conf

echo "Setting PHP INI configuration..."
sed -i "s|memory_limit.*|memory_limit = ${MEMORY_LIMIT}|g" /etc/php81/php.ini
sed -i "s|;date\.timezone.*|date\.timezone = ${TZ}|g" /etc/php81/php.ini
sed -i "s|max_file_uploads.*|max_file_uploads = ${MAX_FILE_UPLOADS}|g" /etc/php81/php.ini
sed -i "s|memory_limit.*|memory_limit = ${MEMORY_LIMIT}|g" /etc/php82/php.ini
sed -i "s|;date\.timezone.*|date\.timezone = ${TZ}|g" /etc/php82/php.ini
sed -i "s|max_file_uploads.*|max_file_uploads = ${MAX_FILE_UPLOADS}|g" /etc/php82/php.ini

# OpCache
echo "Setting OpCache configuration..."
sed -e "s/@OPCACHE_MEM_SIZE@/$OPCACHE_MEM_SIZE/g" \
/tpls/etc/php81/conf.d/opcache.ini > /etc/php81/conf.d/opcache.ini
/tpls/etc/php82/conf.d/opcache.ini > /etc/php82/conf.d/opcache.ini

# Nginx
echo "Setting Nginx configuration..."
Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/cont-init.d/04-create-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cat > /etc/services.d/php-fpm/run <<EOL
#!/usr/bin/execlineb -P
with-contenv
s6-setuidgid ${PUID}:${PGID}
php-fpm81 -F
php-fpm82 -F
EOL
chmod +x /etc/services.d/php-fpm/run

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit c016e04

Please sign in to comment.