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

Upgrade to Alpine 3.20 & PHP 8.3 #416

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# v6.2-0.9.8-0.13.8
ARG RTORRENT_STICKZ_VERSION=0165b4b6dde384d30c2b41ae6d6a2cd23b55c71e

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

FROM --platform=${BUILDPLATFORM} alpine:${ALPINE_VERSION} AS src
Expand Down Expand Up @@ -95,8 +95,8 @@
nghttp2-dev \
openssl-dev \
pcre-dev \
php82-dev \
php82-pear \
php83-dev \
php83-pear \
tar \
tree \
udns-dev \
Expand Down Expand Up @@ -171,13 +171,13 @@
COPY --from=src-geoip2-phpext /src .
RUN <<EOT
set -e
phpize82
phpize83
./configure
make
make install
EOT
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 mkdir -p ${DIST_PATH}/usr/lib/php83/modules
RUN cp -f /usr/lib/php83/modules/geoip.so ${DIST_PATH}/usr/lib/php83/modules/
RUN tree ${DIST_PATH}

WORKDIR /usr/local/src/dump-torrent
Expand All @@ -192,7 +192,7 @@
COPY --from=src-geoip2-rutorrent --chown=nobody:nogroup /src /var/www/rutorrent/plugins/geoip2
COPY --from=src-mmdb /src /var/mmdb

ENV PYTHONPATH="$PYTHONPATH:/var/www/rutorrent" \

Check warning on line 195 in Dockerfile

View workflow job for this annotation

GitHub Actions / test

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$PYTHONPATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 195 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (linux/amd64)

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$PYTHONPATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 195 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (linux/arm/v6)

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$PYTHONPATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 195 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (linux/arm/v7)

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$PYTHONPATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 195 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (linux/arm64)

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$PYTHONPATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
S6_BEHAVIOUR_IF_STAGE2_FAILS="2" \
S6_KILL_GRACETIME="10000" \
TZ="UTC" \
Expand Down Expand Up @@ -229,21 +229,21 @@
nginx-mod-http-dav-ext \
nginx-mod-http-geoip2 \
openssl \
php82 \
php82-bcmath \
php82-ctype \
php82-curl \
php82-dom \
php82-fileinfo \
php82-fpm \
php82-mbstring \
php82-openssl \
php82-phar \
php82-posix \
php82-session \
php82-sockets \
php82-xml \
php82-zip \
php83 \
php83-bcmath \
php83-ctype \
php83-curl \
php83-dom \
php83-fileinfo \
php83-fpm \
php83-mbstring \
php83-openssl \
php83-phar \
php83-posix \
php83-session \
php83-sockets \
php83-xml \
php83-zip \
python3 \
py3-pip \
shadow \
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/php82 \
/var/log/php83 \
/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 @@ -76,17 +76,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/php82/php-fpm.d/www.conf > /etc/php82/php-fpm.d/www.conf
/tpls/etc/php83/php-fpm.d/www.conf > /etc/php83/php-fpm.d/www.conf

echo "Setting PHP INI configuration..."
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
sed -i "s|memory_limit.*|memory_limit = ${MEMORY_LIMIT}|g" /etc/php83/php.ini
sed -i "s|;date\.timezone.*|date\.timezone = ${TZ}|g" /etc/php83/php.ini
sed -i "s|max_file_uploads.*|max_file_uploads = ${MAX_FILE_UPLOADS}|g" /etc/php83/php.ini

# OpCache
echo "Setting OpCache configuration..."
sed -e "s/@OPCACHE_MEM_SIZE@/$OPCACHE_MEM_SIZE/g" \
/tpls/etc/php82/conf.d/opcache.ini > /etc/php82/conf.d/opcache.ini
/tpls/etc/php83/conf.d/opcache.ini > /etc/php83/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-fpm82 -F
php-fpm83 -F
EOL
chmod +x /etc/services.d/php-fpm/run

Expand Down
2 changes: 1 addition & 1 deletion rootfs/tpls/etc/rtorrent/.rtlocal.rc
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ log.add_output = "rpc_events","log"
#log.xmlrpc = (cat,(cfg.logs),"xmlrpc.log")

# Initialize plugins
execute2 = {sh,-c,/usr/bin/php82 /var/www/rutorrent/php/initplugins.php rtorrent &}
execute2 = {sh,-c,/usr/bin/php83 /var/www/rutorrent/php/initplugins.php rtorrent &}
Loading