Skip to content

Commit

Permalink
Merge pull request #84 from LibreCodeCoop/chore/add-support-to-php-8.3
Browse files Browse the repository at this point in the history
chore: add support to php 8.3
  • Loading branch information
vitormattos authored Jan 13, 2025
2 parents 6bed8db + d36741e commit dcfa9ff
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 47 deletions.
33 changes: 18 additions & 15 deletions .docker/Dockerfile.php81
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
FROM php:8.1-fpm

RUN apt-get update \
&& apt-get install -y \
git \
jq \
libicu-dev \
libzip-dev \
procps \
unzip \
# cron
busybox-static \
&& mkdir -p /var/spool/cron/crontabs \
&& echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data

# Install PHP extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod uga+x /usr/local/bin/install-php-extensions && sync \
Expand Down Expand Up @@ -41,20 +28,36 @@ RUN chmod uga+x /usr/local/bin/install-php-extensions && sync \
sysvsem \
xdebug \
zip \
@composer \
&& rm /usr/local/bin/install-php-extensions \
# make possible ImageMagic handle PDF files
&& sed -i'' 's|.*<policy domain="coder".*"PDF".*|<policy domain="coder" rights="read \| write" pattern="PDF" />|g' /etc/ImageMagick-6/policy.xml \
# pevent errors when try to create files at /var/www with user www-data
&& chown -R www-data /var/www

# Run separate to prevent build all extensions
RUN apt-get update \
&& apt-get install -y \
git \
jq \
libicu-dev \
libzip-dev \
poppler-utils \
procps \
unzip \
# cron
busybox-static \
&& mkdir -p /var/spool/cron/crontabs \
&& echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data \
&& rm -rf /var/lib/apt/lists/*

# Install NVM
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
&& export NVM_DIR="/root/.nvm" \
&& . "$NVM_DIR/nvm.sh" \
&& nvm install 14 && nvm install 16 && nvm install 20 \
&& nvm install 20 \
&& nvm alias default 20

COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY config/php/* /usr/local/etc/php/conf.d/
COPY scripts/* /var/www/scripts/
COPY bin/* /usr/local/bin/
Expand Down
33 changes: 18 additions & 15 deletions .docker/Dockerfile.php82
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
FROM php:8.2-fpm

RUN apt-get update \
&& apt-get install -y \
git \
jq \
libicu-dev \
libzip-dev \
procps \
unzip \
# cron
busybox-static \
&& mkdir -p /var/spool/cron/crontabs \
&& echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data

# Install PHP extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod uga+x /usr/local/bin/install-php-extensions && sync \
Expand Down Expand Up @@ -41,20 +28,36 @@ RUN chmod uga+x /usr/local/bin/install-php-extensions && sync \
sysvsem \
xdebug \
zip \
@composer \
&& rm /usr/local/bin/install-php-extensions \
# make possible ImageMagic handle PDF files
&& sed -i'' 's|.*<policy domain="coder".*"PDF".*|<policy domain="coder" rights="read \| write" pattern="PDF" />|g' /etc/ImageMagick-6/policy.xml \
# pevent errors when try to create files at /var/www with user www-data
&& chown -R www-data /var/www

# Run separate to prevent build all extensions
RUN apt-get update \
&& apt-get install -y \
git \
jq \
libicu-dev \
libzip-dev \
poppler-utils \
procps \
unzip \
# cron
busybox-static \
&& mkdir -p /var/spool/cron/crontabs \
&& echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data \
&& rm -rf /var/lib/apt/lists/*

# Install NVM
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
&& export NVM_DIR="/root/.nvm" \
&& . "$NVM_DIR/nvm.sh" \
&& nvm install 14 && nvm install 16 && nvm install 20 \
&& nvm install 20 \
&& nvm alias default 20

COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY config/php/* /usr/local/etc/php/conf.d/
COPY scripts/* /var/www/scripts/
COPY bin/* /usr/local/bin/
Expand Down
35 changes: 19 additions & 16 deletions .docker/Dockerfile.php80 → .docker/Dockerfile.php83
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
FROM php:8.0-fpm

RUN apt-get update \
&& apt-get install -y \
git \
jq \
libicu-dev \
libzip-dev \
procps \
unzip \
# cron
busybox-static \
&& mkdir -p /var/spool/cron/crontabs \
&& echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data
FROM php:8.3-fpm

# Install PHP extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
Expand Down Expand Up @@ -41,20 +28,36 @@ RUN chmod uga+x /usr/local/bin/install-php-extensions && sync \
sysvsem \
xdebug \
zip \
@composer \
&& rm /usr/local/bin/install-php-extensions \
# make possible ImageMagic handle PDF files
&& sed -i'' 's|.*<policy domain="coder".*"PDF".*|<policy domain="coder" rights="read \| write" pattern="PDF" />|g' /etc/ImageMagick-6/policy.xml \
# pevent errors when try to create files at /var/www with user www-data
&& chown -R www-data /var/www

# Run separate to prevent build all extensions
RUN apt-get update \
&& apt-get install -y \
git \
jq \
libicu-dev \
libzip-dev \
poppler-utils \
procps \
unzip \
# cron
busybox-static \
&& mkdir -p /var/spool/cron/crontabs \
&& echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data \
&& rm -rf /var/lib/apt/lists/*

# Install NVM
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
&& export NVM_DIR="/root/.nvm" \
&& . "$NVM_DIR/nvm.sh" \
&& nvm install 14 && nvm install 16 && nvm install 20 \
&& nvm install 20 \
&& nvm alias default 20

COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY config/php/* /usr/local/etc/php/conf.d/
COPY scripts/* /var/www/scripts/
COPY bin/* /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion .docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ http {
# only for Nextcloud like below:
include mime.types;
types {
text/javascript js mjs;
application/javascript js mjs;
}

# Specify how to handle directories -- specifying `/index.php$request_uri`
Expand Down

0 comments on commit dcfa9ff

Please sign in to comment.