This commit is contained in:
root
2024-08-11 02:20:31 +02:00
parent 6cc12b4b4a
commit 5e64a11c79
5 changed files with 173 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
# Use the official PHP 8.2.16-fpm-bullseye base image
FROM php:5.4-fpm
# Update package lists and install necessary packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
net-tools \
wget \
curl \
libssl-dev \
libnss3 \
nano \
procps \
nodejs \
gcc \
g++ \
make \
yarn && \
rm -rf /var/lib/apt/lists/*
# Install Composer
RUN curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php && \
HASH=`curl -sS https://composer.github.io/installer.sig` && \
php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('/tmp/composer-setup.php'); } echo PHP_EOL;" && \
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
rm -rf /tmp/composer-setup.php
# Install PHP extensions using mlocati's script
RUN curl -sSLf -o /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions gd bz2 zip redis pdo_mysql mysqli mcrypt
WORKDIR /srv
USER root
+117
View File
@@ -0,0 +1,117 @@
# Use Ubuntu 20.04 as a base image
FROM ubuntu:20.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary packages for building PHP and required extensions
RUN apt-get update && apt-get install -y \
autoconf \
build-essential \
curl \
libcurl4-openssl-dev \
libxml2-dev \
libssl-dev \
libbz2-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev \
libicu-dev \
libmcrypt-dev \
libmagickwand-dev \
libmemcached-dev \
libzip-dev \
libpng-dev \
libonig-dev \
libsodium-dev \
libsqlite3-dev \
libxslt1-dev \
pkg-config \
zlib1g-dev \
wget \
libtool \
libpcre3-dev \
libbz2-dev \
libxpm-dev \
libwebp-dev \
libgmp-dev \
libldap2-dev \
libicu-dev \
libedit-dev \
libxslt1-dev \
re2c \
curl \
libcurl4-openssl-dev \
bison \
&& apt-get clean
# Download and extract PHP 5.4 source code
RUN curl -fsSL https://museum.php.net/php5/php-5.4.45.tar.gz | tar -xz \
&& cd php-5.4.45 \
&& ./configure --prefix=/usr/local/php \
--with-config-file-path=/usr/local/php \
--enable-fpm \
--with-fpm-user=www-data \
--with-fpm-group=www-data \
--with-curl \
--with-openssl \
--with-zlib \
--enable-mbstring \
--enable-intl \
--enable-soap \
--enable-exif \
--enable-bcmath \
--enable-sockets \
--with-mysqli \
--with-pdo-mysql \
--with-iconv \
--with-bz2 \
--enable-zip \
--enable-opcache \
--with-xsl \
--with-gd \
--enable-gd-native-ttf \
--with-freetype-dir=/usr/include/freetype2 \
--with-jpeg-dir=/usr/lib \
--with-png-dir=/usr/lib \
--with-xpm-dir=/usr/lib \
--enable-simplexml \
--enable-shmop \
--enable-json \
--enable-hash \
--with-gettext \
--with-kerberos \
--enable-filter \
--enable-pcntl \
--enable-opcache \
--enable-fpm \
--enable-calendar \
--with-mcrypt \
&& make -j$(nproc) \
&& make install \
&& cp php.ini-production /usr/local/php/php.ini
# Install PECL extensions
RUN pecl channel-update pecl.php.net \
&& pecl install imagick \
&& pecl install igbinary \
&& pecl install redis \
&& pecl install memcached \
&& pecl install timezonedb \
&& docker-php-ext-enable imagick igbinary redis memcached timezonedb
# Set up PHP-FPM config
COPY php-fpm.conf /usr/local/php/etc/php-fpm.conf
COPY www.conf /usr/local/php/etc/php-fpm.d/www.conf
# Clean up
RUN apt-get remove -y build-essential autoconf \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /php-5.4.45
# Set up the entrypoint for php-fpm
ENTRYPOINT ["/usr/local/php/sbin/php-fpm"]
# Expose port 9000 and keep the container running
CMD ["--nodaemonize"]
View File
+23
View File
@@ -0,0 +1,23 @@
services:
php73:
hostname: php73
container_name: php73
image: php:7.3.33-fpm-bullseye
restart: always
privileged: true
volumes:
- /srv:/srv:rw
- /apps_data/php73/config/etc:/apps_data/php73/config/etc:rw
dns:
- "1.1.1.1"
- "1.1.0.0"
ulimits:
nproc: 65535
cap_add:
- "ALL"
networks:
web:
ipv4_address: 172.28.32.73
networks:
web:
external: true
View File