Skip to content

Commit

Permalink
feat: v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
telanflow committed Jun 7, 2023
1 parent 3eaedeb commit 8e09ef4
Show file tree
Hide file tree
Showing 68 changed files with 12,980 additions and 423 deletions.
32 changes: 2 additions & 30 deletions .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,10 @@ MONGODB_PORT=27017
MONGODB_INITDB_ROOT_USERNAME=admin
MONGODB_INITDB_ROOT_PASSWORD=admin

#
# ElasticSearch 配置
#
# Available ELASTICSEARCH_PLUGINS:
#
# amazon-ec2,analysis-icu,analysis-kuromoji,analysis-nori,
# analysis-phonetic,analysis-smartcn,analysis-stempel,
# analysis-ukrainian,discovery-azure-classic,discovery-ec2,
# discovery-file,discovery-gce,google-cloud-storage,
# ingest-attachment,ingest-geoip,ingest-user-agent,mapper-murmur3,
# mapper-size,microsoft-azure-storage,qa,repository-azure,
# repository-gcs,repository-hdfs,repository-s3,store-smb,
# analysis-ik,analysis-pinyin
#
# You can let it empty to avoid installing any plugins,
# or install plugins as:
# ELASTICSEARCH_PLUGINS=analysis-ik,analysis-pinyin
#
ELASTICSEARCH_VERSION=7.1.1
ELASTICSEARCH_HOST_PORT_C=9200
ELASTICSEARCH_HOST_PORT_S=9300
ELASTICSEARCH_PLUGINS=analysis-ik,analysis-pinyin

###################### PHP 配置
PHP56_FPM_PORT=9056
PHP72_FPM_PORT=9072
PHP74_FPM_PORT=9074
PHP80_FPM_PORT=9080
PHP81_FPM_PORT=9081

###################### SUPERVISOR_PHP
SUPERVISOR_PHP_VERSION=7.4.1
SUPERVISOR_PHP_PHP_CONF_FILE=./build/phpsupervisor/php.ini
SUPERVISOR_PHP_LOG_DIR=./log/phpsupervisor
SUPERVISOR_PHP_EXTENSIONS=pdo_mysql,mysqli,mbstring,gd,curl,opcache,swoole
SUPERVISOR_HOST_PORT_C=9001
PHP82_FPM_PORT=9082
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
# DNMP 1.4.2
<h1 align="center">
<br>DNMP 1.5.0<br>
</h1>

DNMP 可以构建出基于 Docker 的 PHP 开发环境,其优势有在短时间内随意构建不同版本的相关服务、环境统一分布在不同服务器等,使开发者能够更专注于开发业务本身。

> 友情提示:请务必配置 DockerHub 加速器(方法见底部),不然会镜像下载超时。
### 产品特色
## 📖 产品特色

* 灵活切换适合国内的源(apt-get、php composer)
* 组件精简易懂,学习、测试环境、生产环境均适合
* 良好的扩展性

### 组件(容器)及相关软件版本
## 🚀 组件(容器)及相关软件版本

* Ningx:latest
* PHP56:php-fpm 5.6.x `composer:1.8.0 swoole:1.10.5 redis:4.3.0`
* PHP74:php-fpm 7.4.x `composer:2.1.11 swoole:4.8.7 redis:5.3.7 mongodb:1.12.1`
* PHP80:php-fpm 8.0.x `composer:2.1.11 swoole:4.8.7 redis:5.3.7 mongodb:1.12.1`
* PHP81:php-fpm 8.1.x `composer:2.1.11 swoole:4.8.7 redis:5.3.7 mongodb:1.12.1`
* PHP56:php-fpm 5.6.x `composer:2.2.x swoole:1.10.5 redis:4.3.0`
* PHP72:php-fpm 7.2.x `composer:2.5.7 swoole:4.8.13 redis:5.3.7 mongodb:1.15.3`
* PHP74:php-fpm 7.4.x `composer:2.5.7 swoole:4.8.13 redis:5.3.7 mongodb:1.15.3`
* PHP80:php-fpm 8.0.x `composer:2.5.7 swoole:5.0.3 redis:5.3.7 mongodb:1.15.3`
* PHP81:php-fpm 8.1.x `composer:2.5.7 swoole:5.0.3 redis:5.3.7 mongodb:1.15.3`
* PHP82:php-fpm 8.2.x `composer:2.5.7 swoole:5.0.3 redis:5.3.7 mongodb:1.15.3`
* MySQL:5.7
* Redis:latest `默认密码:dnmp`
* Mogodb: latest `默认验证数据库:admin 账号:admin 密码:admin`
* ~~ElasticSearch:7.1.1~~

### 目录结构

Expand All @@ -32,7 +35,7 @@ DNMP 可以构建出基于 Docker 的 PHP 开发环境,其优势有在短时
|----/.env-example 配置文件示例
|----/docker-compose.yml docker compose 配置文件

## 开始安装
## 🛠 开始安装

没有安装 Docker 的同学移步 [安装教程](https://github.com/telanflow/dnmp.git#安装-docker-及相关工具),如果你有足够的时间强烈建议通读 [Docker — 从入门到实践](https://yeasy.gitbooks.io/docker_practice/content/)

Expand All @@ -49,10 +52,10 @@ DNMP 可以构建出基于 Docker 的 PHP 开发环境,其优势有在短时
sudo docker-compose up --build -d

# 构建单个镜像并启动容器
sudo docker-compose up --build -d [nginx|php56|php74|php80 ...]
sudo docker-compose up --build -d [nginx|php56|php72|php74|php80 ...]

# 构建单个镜像
sudo docker-compose build --no-cache [nginx|php56|php74|php80 ...]
sudo docker-compose build --no-cache [nginx|php56|php72|php74|php80 ...]

> 📢 注意:dnmp部署完成后,需要修改redis服务的密码`config/redis/redis.conf 设置 requirepass dnmp(替换成你自己的密码)`
Expand Down Expand Up @@ -185,5 +188,5 @@ DaoCloud 加速器:http://guide.daocloud.io/dcs/daocloud-9153151.html

腾讯云加速器:https://www.qcloud.com/document/product/457/7207

### License
MIT
## 📄 License
[MIT License](/LICENSE)
125 changes: 0 additions & 125 deletions build/elasticsearch/Dockerfile

This file was deleted.

Binary file modified build/php56/resource/composer.phar
Binary file not shown.
116 changes: 116 additions & 0 deletions build/php72/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
FROM php:7.2-fpm-buster

COPY resource /home/resource

ARG CHANGE_SOURCE=true
ARG TIME_ZONE=UTC

ARG MongoDB=mongodb-1.12.1.tgz
ARG OPEN_SWOOLE=openswoole-4.10.0.tgz
ARG SWOOLE=swoole-4.8.13.tgz
ARG REDIS=redis-5.3.7.tgz
ARG MCRYPT=mcrypt-1.0.4.tgz
ARG XDEBUG=xdebug-3.1.3.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; \
\
# ⬇ MongoDB
pecl install /home/resource/$MongoDB ; \
echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongodb.ini ; \
\
# ⬇ Redis
pecl install /home/resource/$REDIS ; \
echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini ; \
# \
# # ⬇ Open Swoole
# pecl install /home/resource/$OPEN_SWOOLE ; \
# echo "extension=openswoole.so" > /usr/local/etc/php/conf.d/openswoole.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 added build/php72/resource/composer.phar
Binary file not shown.
Binary file added build/php72/resource/mcrypt-1.0.4.tgz
Binary file not shown.
Binary file added build/php72/resource/mongodb-1.15.3.tgz
Binary file not shown.
Binary file added build/php72/resource/redis-5.3.7.tgz
Binary file not shown.
4 changes: 4 additions & 0 deletions build/php72/resource/sources.list
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 added build/php72/resource/swoole-4.8.13.tgz
Binary file not shown.
File renamed without changes.
2 changes: 1 addition & 1 deletion build/php74/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG TIME_ZONE=UTC

ARG MongoDB=mongodb-1.12.1.tgz
ARG OPEN_SWOOLE=openswoole-4.10.0.tgz
ARG SWOOLE=swoole-4.8.7.tgz
ARG SWOOLE=swoole-4.8.13.tgz
ARG REDIS=redis-5.3.7.tgz
ARG MCRYPT=mcrypt-1.0.4.tgz
ARG XDEBUG=xdebug-3.1.3.tgz
Expand Down
Binary file modified build/php74/resource/composer.phar
100644 → 100755
Binary file not shown.
Binary file removed build/php74/resource/mongodb-1.12.1.tgz
Binary file not shown.
Binary file added build/php74/resource/mongodb-1.15.3.tgz
Binary file not shown.
Binary file added build/php74/resource/swoole-4.8.13.tgz
Binary file not shown.
Binary file removed build/php74/resource/swoole-4.8.7.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions build/php80/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ ARG TIME_ZONE=UTC

ARG MongoDB=mongodb-1.12.1.tgz
ARG OPEN_SWOOLE=openswoole-4.10.0.tgz
ARG SWOOLE=swoole-4.8.7.tgz
ARG SWOOLE=swoole-5.0.3.tgz
ARG REDIS=redis-5.3.7.tgz
ARG MCRYPT=mcrypt-1.0.4.tgz
ARG XDEBUG=xdebug-3.1.3.tgz
ARG XDEBUG=xdebug-3.2.1.tgz

ENV TIME_ZONE=${TIME_ZONE} LC_ALL=C.UTF-8

Expand Down
Binary file modified build/php80/resource/composer.phar
100644 → 100755
Binary file not shown.
Binary file removed build/php80/resource/mongodb-1.12.1.tgz
Binary file not shown.
Binary file added build/php80/resource/mongodb-1.15.3.tgz
Binary file not shown.
Binary file removed build/php80/resource/swoole-4.8.7.tgz
Binary file not shown.
Binary file added build/php80/resource/swoole-5.0.3.tgz
Binary file not shown.
Binary file added build/php80/resource/xdebug-3.2.1.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions build/php81/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ ARG TIME_ZONE=UTC

ARG MongoDB=mongodb-1.12.1.tgz
ARG OPEN_SWOOLE=openswoole-4.10.0.tgz
ARG SWOOLE=swoole-4.8.7.tgz
ARG SWOOLE=swoole-5.0.3.tgz
ARG REDIS=redis-5.3.7.tgz
ARG MCRYPT=mcrypt-1.0.4.tgz
ARG XDEBUG=xdebug-3.1.3.tgz
ARG XDEBUG=xdebug-3.2.1.tgz

ENV TIME_ZONE=${TIME_ZONE} LC_ALL=C.UTF-8

Expand Down
Binary file modified build/php81/resource/composer.phar
100644 → 100755
Binary file not shown.
Binary file removed build/php81/resource/mongodb-1.12.1.tgz
Binary file not shown.
Binary file added build/php81/resource/mongodb-1.15.3.tgz
Binary file not shown.
Binary file removed build/php81/resource/swoole-4.8.7.tgz
Binary file not shown.
Binary file added build/php81/resource/swoole-5.0.3.tgz
Binary file not shown.
Binary file removed build/php81/resource/xdebug-3.1.3.tgz
Binary file not shown.
Binary file added build/php81/resource/xdebug-3.2.1.tgz
Binary file not shown.
Loading

0 comments on commit 8e09ef4

Please sign in to comment.