Skip to content

Commit

Permalink
PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Nov 22, 2024
1 parent 34c2fe7 commit abeab09
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ jobs:
- item: "8.2-fpm"
- item: "8.3"
- item: "8.3-fpm"
- item: "8.4"
- item: "8.4-fpm"

fail-fast: false
72 changes: 72 additions & 0 deletions 8.4-fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
FROM dockette/debian:bullseye

LABEL maintainer="[email protected]"

# PHP
ENV PHP_MODS_DIR=/etc/php/8.4/mods-available
ENV PHP_CLI_DIR=/etc/php/8.4/cli
ENV PHP_CLI_CONF_DIR=${PHP_CLI_DIR}/conf.d
ENV PHP_CGI_DIR=/etc/php/8.4/cgi
ENV PHP_CGI_CONF_DIR=${PHP_CGI_DIR}/conf.d
ENV PHP_FPM_DIR=/etc/php/8.4/fpm
ENV PHP_FPM_CONF_DIR=${PHP_FPM_DIR}/conf.d
ENV PHP_FPM_POOL_DIR=${PHP_FPM_DIR}/pool.d
ENV TZ=Europe/Prague

# INSTALLATION
RUN apt update && apt dist-upgrade -y && \
# DEPENDENCIES #############################################################
apt install -y wget curl apt-transport-https ca-certificates lsb-release git unzip && \
# PHP DEB.SURY.CZ ##########################################################
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list && \
apt update && \
apt dist-upgrade -y && \
apt install -y --no-install-recommends \
php8.4-apcu \
php8.4-bz2 \
php8.4-bcmath \
php8.4-calendar \
php8.4-cgi \
php8.4-cli \
php8.4-ctype \
php8.4-curl \
php8.4-fpm \
php8.4-gettext \
php8.4-gd \
php8.4-intl \
php8.4-imap \
php8.4-ldap \
php8.4-mbstring \
php8.4-memcached \
php8.4-mysql \
php8.4-pdo \
php8.4-pgsql \
php8.4-soap \
php8.4-sqlite3 \
php8.4-zip \
php8.4-xmlrpc \
php8.4-xsl && \
# COMPOSER #################################################################
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --2 && \
# PHP MOD(s) ###############################################################
ln -s ${PHP_MODS_DIR}/custom.ini ${PHP_CLI_CONF_DIR}/999-custom.ini && \
ln -s ${PHP_MODS_DIR}/custom.ini ${PHP_CGI_CONF_DIR}/999-custom.ini && \
ln -s ${PHP_MODS_DIR}/custom.ini ${PHP_FPM_CONF_DIR}/999-custom.ini && \
# CLEAN UP #################################################################
rm ${PHP_FPM_POOL_DIR}/www.conf && \
apt-get clean -y && \
apt-get autoclean -y && \
apt-get remove -y wget curl lsb-release && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/*

# FILES (it overrides originals)
ADD conf.d/custom.ini ${PHP_MODS_DIR}/custom.ini
ADD fpm/php-fpm.conf ${PHP_FPM_DIR}/php-fpm.conf

# WORKDIR
WORKDIR /srv

# COMMAND
CMD ["php-fpm8.4"]
13 changes: 13 additions & 0 deletions 8.4-fpm/conf.d/custom.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
; Update memory
memory_limit = 521M
upload_max_filesize = 256M
post_max_size = 256M

; Dates
date.timezone=Europe/Prague

; Mailer
;sendmail_path = /usr/local/bin/phpmailer

; No disabled functions
;disable_functions =
31 changes: 31 additions & 0 deletions 8.4-fpm/fpm/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[global]

error_log = /proc/self/fd/2
daemonize = no

[www]

access.log = /proc/self/fd/2

user = www-data
group = www-data

listen = [::]:9000
listen.owner = www-data
listen.group = www-data
listen.mode = 0660

pm = dynamic
pm.max_children = 9
pm.start_servers = 3
pm.min_spare_servers = 2
pm.max_spare_servers = 3
pm.max_requests = 200
catch_workers_output = yes
clear_env = yes

php_admin_value[sendmail_path] = /usr/local/bin/phpmailer
php_admin_value[open_basedir]= "/data:/srv:/var/tmp:/tmp"
php_admin_value[upload_tmp_dir] = "/var/tmp"

include=/etc/php/8.4/fpm/pool.d/*.conf
65 changes: 65 additions & 0 deletions 8.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
FROM dockette/debian:bullseye

LABEL maintainer="[email protected]"

# PHP
ENV PHP_MODS_DIR=/etc/php/8.4/mods-available
ENV PHP_CLI_DIR=/etc/php/8.4/cli
ENV PHP_CLI_CONF_DIR=${PHP_CLI_DIR}/conf.d
ENV PHP_CGI_DIR=/etc/php/8.4/cgi
ENV PHP_CGI_CONF_DIR=${PHP_CGI_DIR}/conf.d
ENV TZ=Europe/Prague

# INSTALLATION
RUN apt update && apt dist-upgrade -y && \
# DEPENDENCIES #############################################################
apt install -y wget curl apt-transport-https ca-certificates lsb-release git unzip && \
# PHP DEB.SURY.CZ ##########################################################
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list && \
apt update && \
apt dist-upgrade -y && \
apt install -y --no-install-recommends \
php8.4-apcu \
php8.4-bcmath \
php8.4-bz2 \
php8.4-calendar \
php8.4-cgi \
php8.4-cli \
php8.4-ctype \
php8.4-curl \
php8.4-gettext \
php8.4-gd \
php8.4-intl \
php8.4-imap \
php8.4-ldap \
php8.4-mbstring \
php8.4-memcached \
php8.4-mysql \
php8.4-pdo \
php8.4-pgsql \
php8.4-soap \
php8.4-sqlite3 \
php8.4-zip \
php8.4-xmlrpc \
php8.4-xsl && \
# COMPOSER #################################################################
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --2 && \
# PHP MOD(s) ###############################################################
ln -s ${PHP_MODS_DIR}/custom.ini ${PHP_CLI_CONF_DIR}/999-custom.ini && \
ln -s ${PHP_MODS_DIR}/custom.ini ${PHP_CGI_CONF_DIR}/999-custom.ini && \
# CLEAN UP #################################################################
apt-get clean -y && \
apt-get autoclean -y && \
apt-get remove -y wget curl lsb-release && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /var/lib/log/* /tmp/* /var/tmp/*

# FILES (it overrides originals)
ADD conf.d/custom.ini ${PHP_MODS_DIR}/custom.ini

# WORKDIR
WORKDIR /srv

# COMMAND
CMD ["php"]
13 changes: 13 additions & 0 deletions 8.4/conf.d/custom.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
; Update memory
memory_limit = 521M
upload_max_filesize = 256M
post_max_size = 256M

; Dates
date.timezone=Europe/Prague

; Mailer
;sendmail_path = /usr/local/bin/phpmailer

; No disabled functions
;disable_functions =
46 changes: 24 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
DOCKER_IMAGE=dockette/php

_docker-build-%: VERSION=$*
_docker-build-%:
_build-%: VERSION=$*
_build-%:
docker build \
--pull \
-t ${DOCKER_IMAGE}:${VERSION} \
./${VERSION}

docker-build-5.6: _docker-build-5.6
docker-build-5.6-fpm: _docker-build-5.6-fpm
docker-build-7.0: _docker-build-7.0
docker-build-7.0-fpm: _docker-build-7.0-fpm
docker-build-7.1: _docker-build-7.1
docker-build-7.1-fpm: _docker-build-7.1-fpm
docker-build-7.2: _docker-build-7.2
docker-build-7.2-fpm: _docker-build-7.2-fpm
docker-build-7.3: _docker-build-7.3
docker-build-7.3-fpm: _docker-build-7.3-fpm
docker-build-7.4: _docker-build-7.4
docker-build-7.4-fpm: _docker-build-7.4-fpm
docker-build-8.0: _docker-build-8.0
docker-build-8.0-fpm: _docker-build-8.0-fpm
docker-build-8.1: _docker-build-8.1
docker-build-8.1-fpm: _docker-build-8.1-fpm
docker-build-8.2: _docker-build-8.2
docker-build-8.2-fpm: _docker-build-8.2-fpm
docker-build-8.3: _docker-build-8.3
docker-build-8.3-fpm: _docker-build-8.3-fpm
build-5.6: _build-5.6
build-5.6-fpm: _build-5.6-fpm
build-7.0: _build-7.0
build-7.0-fpm: _build-7.0-fpm
build-7.1: _build-7.1
build-7.1-fpm: _build-7.1-fpm
build-7.2: _build-7.2
build-7.2-fpm: _build-7.2-fpm
build-7.3: _build-7.3
build-7.3-fpm: _build-7.3-fpm
build-7.4: _build-7.4
build-7.4-fpm: _build-7.4-fpm
build-8.0: _build-8.0
build-8.0-fpm: _build-8.0-fpm
build-8.1: _build-8.1
build-8.1-fpm: _build-8.1-fpm
build-8.2: _build-8.2
build-8.2-fpm: _build-8.2-fpm
build-8.3: _build-8.3
build-8.3-fpm: _build-8.3-fpm
build-8.4: _build-8.4
build-8.4-fpm: _build-8.4-fpm
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align=center>Dockette / PHP</h1>

<p align=center>
Ready-to-use Debian based images for PHP 5.6-8.3 with CLI or FPM and Composer preinstalled.
Ready-to-use Debian based images for PHP 5.6-8.4 with CLI or FPM and Composer preinstalled.
</p>

<p align=center>
Expand All @@ -23,6 +23,8 @@
## Usage

```
docker run -v /path/to/site:/srv dockette/php:8.4
docker run -v /path/to/site:/srv dockette/php:8.4-fpm
docker run -v /path/to/site:/srv dockette/php:8.3
docker run -v /path/to/site:/srv dockette/php:8.3-fpm
docker run -v /path/to/site:/srv dockette/php:8.2
Expand All @@ -48,7 +50,7 @@ docker run -v /path/to/site:/srv dockette/php:5.6-fpm
**Base image**

```Dockerfile
FROM dockette/php:8.1-fpm
FROM dockette/php:8.4-fpm

RUN apt update && apt install -y curl
```
Expand Down

0 comments on commit abeab09

Please sign in to comment.