-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Feature 1. support `PHP 8.1.x` 2. `nginx` build form Dockerfile ## Dependencies 1. `swoole` To 4.8.5 2. `redis` To 5.3.5
- Loading branch information
Showing
33 changed files
with
6,474 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
FROM php:8.1-fpm-buster | ||
|
||
COPY resource /home/resource | ||
|
||
ARG CHANGE_SOURCE=true | ||
ARG TIME_ZONE=UTC | ||
|
||
ARG SWOOLE=swoole-4.8.5.tgz | ||
ARG REDIS=redis-5.3.5.tgz | ||
ARG MCRYPT=mcrypt-1.0.4.tgz | ||
|
||
ENV TIME_ZONE=${TIME_ZONE} LC_ALL=C.UTF-8 | ||
|
||
RUN set -eux; \ | ||
# ⬇ 修改时区 | ||
ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime ; \ | ||
echo $TIME_ZONE > /etc/timezone ; \ | ||
\ | ||
# ⬇ 安装 PHP Composer | ||
mv /home/resource/composer.phar /usr/local/bin/composer ; \ | ||
chmod 755 /usr/local/bin/composer ; \ | ||
\ | ||
# ⬇ 替换源 | ||
rm -rf /etc/apt/sources.list.d/buster.list ; \ | ||
if [ ${CHANGE_SOURCE} = true ]; then \ | ||
mv /etc/apt/sources.list /etc/apt/source.list.bak; \ | ||
mv /home/resource/sources.list /etc/apt/sources.list; \ | ||
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ ; \ | ||
fi; \ | ||
\ | ||
# ⬇ 更新、安装基础组件 | ||
apt-get update; \ | ||
apt-get upgrade -y; \ | ||
apt-get install -y --allow-remove-essential --no-install-recommends \ | ||
# tools | ||
wget \ | ||
zip \ | ||
unzip \ | ||
git \ | ||
cron \ | ||
vim \ | ||
iputils-ping \ | ||
telnet \ | ||
net-tools \ | ||
\ | ||
libmagickwand-dev \ | ||
libz-dev \ | ||
# intl | ||
libicu-dev \ | ||
# bz2 | ||
libbz2-dev \ | ||
# zip | ||
libzip-dev \ | ||
# ldap | ||
libldb-dev \ | ||
libldap2-dev \ | ||
# mcrypt | ||
libmcrypt-dev \ | ||
# other | ||
libtinfo5 \ | ||
libpq-dev \ | ||
libjpeg-dev \ | ||
libpng-dev \ | ||
libfreetype6-dev \ | ||
libssl-dev \ | ||
libfreetype6-dev \ | ||
libjpeg62-turbo-dev \ | ||
zlib1g-dev \ | ||
libpng-dev \ | ||
procps \ | ||
libmhash-dev \ | ||
librabbitmq-dev \ | ||
ntpdate ; | ||
|
||
#################################################################################### | ||
# 安装 PHP 扩展 | ||
#################################################################################### | ||
|
||
RUN docker-php-ext-configure gd \ | ||
--with-freetype-dir=/usr/include/ \ | ||
--with-jpeg-dir=/usr/include/ ; \ | ||
docker-php-ext-install -j$(nproc) gd intl pdo_mysql ldap mysqli bz2 zip sockets pgsql pdo_pgsql bcmath soap pcntl; \ | ||
# \ | ||
# ⬇ XDebug | ||
# pecl install /home/resource/$XDEBUG ; \ | ||
\ | ||
# ⬇ Imagick | ||
pecl install imagick && docker-php-ext-enable imagick; \ | ||
\ | ||
# ⬇ Redis | ||
pecl install /home/resource/$REDIS ; \ | ||
echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini ; \ | ||
\ | ||
# ⬇ Swoole | ||
pecl install /home/resource/$SWOOLE ; \ | ||
echo "extension=swoole.so" > /usr/local/etc/php/conf.d/swoole.ini ; \ | ||
\ | ||
# ⬇ Mcrypt | ||
pecl install /home/resource/$MCRYPT ; \ | ||
echo "extension=mcrypt.so" > /usr/local/etc/php/conf.d/mcrypt.ini ; \ | ||
\ | ||
# ⬇ 清理 | ||
rm -rf /var/lib/apt/lists/* ; \ | ||
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ; \ | ||
rm -rf /home/resource ; |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib | ||
deb http://mirrors.aliyun.com/debian-security buster/updates main | ||
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib | ||
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
location ~ \.php$ { | ||
fastcgi_pass dnmp-php81:9000; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.