Skip to content

Commit

Permalink
Merge pull request #6 from ogenes/production
Browse files Browse the repository at this point in the history
多版本PHP
  • Loading branch information
ogenes authored Jan 13, 2023
2 parents 3554062 + e175fd4 commit 8b4ec79
Show file tree
Hide file tree
Showing 61 changed files with 16,231 additions and 326 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{js,json,scss,vue,yml,yaml,sh}]
indent_size = 2
52 changes: 24 additions & 28 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,50 +1,46 @@
WEB_ROOT_PATH=./www
WEB_ROOT_PATH=../www

### NGINX ################################################
### NGINX #####################################
NGINX_HOST_HTTP_PORT=80
NGINX_HOST_HTTPS_PORT=443
NGINX_LOG_PATH=./logs/nginx/

### MYSQL 5.7 | 8.0 ######################################
MYSQL_VERSION=5.7
### MYSQL 5.7 | 8.0 ###########################
MYSQL_VERSION=5.7.40
MYSQL_DATA_PATH=./data/mysql
MYSQL_CONF_PATH=./mysql/docker.cnf
MYSQL_PORT=3306
MYSQL_TIMEZONE=Asia/Shanghai
MYSQL_ROOT_PASSWORD=123456

### PHP 7.1 | 7.2 | 7.3 | 7.4 | 8.0 ######################
PHP_VERSION=7.4
PHP_INSTALL_REDIS=true
PHP_LOG_PATH=./logs/php/

### REDIS 4.0 | 5.0 | 6.0 #################################
### REDIS #####################################
REDIS_VERSION=5.0
REDIS_DATA_PATH=./data/redis5
REDIS_CONF_PATH=./redis/redis5.conf
REDIS_PORT=6379

### MONGO 4.4 #################################
MONGO_VERSION=4.4
MONGO_DATA_PATH=./data/mongo
MONGO_CONF_PATH=./mongo/mongod.conf
MONGO_PORT=27017
MONGO_ROOT_USERNAME=root
MONGO_ROOT_PASSWORD=123456

### ElasticSearch 7.17 ########################
ELASTICSEARCH_DATA_PATH=./data/elasticsearch/data
ELASTICSEARCH_PLUGINS_PATH=./data/elasticsearch/plugins
ELASTICSEARCH_PATH=./data/elasticsearch/

### Kibana 7.17 ########################
KIBANA_PORT=5602
KIBANA_PORT=5601
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=123456

### IPV4_ADDRESS ##############################
SUBNET=172.19.0.0/16
NGINX_IP=172.19.0.6
PHP_IP=172.19.0.5
MYSQL_IP=172.19.0.4
REDIS_IP=172.19.0.3
MONGO_IP=172.19.0.2
ELASTICSEARCH_IP=172.19.0.8
KIBANA_IP=172.19.0.9
NGINX_IP=172.19.0.2
MYSQL_IP=172.19.0.3
REDIS_IP=172.19.0.4
ELASTICSEARCH_IP=172.19.0.5
KIBANA_IP=172.19.0.6
ES01_IP=172.19.0.7
ES02_IP=172.19.0.8
ES03_IP=172.19.0.9
PHP56_IP=172.19.0.56
PHP71_IP=172.19.0.71
PHP72_IP=172.19.0.72
PHP73_IP=172.19.0.73
PHP74_IP=172.19.0.74
PHP80_IP=172.19.0.80
PHP81_IP=172.19.0.81
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
.env

.DS_Store

/nginx/conf.d/*.conf
id_rsa*
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
1. docker-lnmp 项目帮助开发者快速构建本地开发环境,包括Nginx、PHP、MySQL、Redis、MongoDB、ElasticSearch、Kibana服务镜像,支持服务版本切换,并支持配置文件和日志文件映射,不限操作系统;
2. 此项目适合个人开发者本机部署,可以快速切换服务版本满足学习服务新版本的需求; 也适合团队中统一开发环境,设定好配置后一键部署, 便于提高团队开发效率;
2. PHP 支持 php7.2、php7.3、php7.4、php8.0 版本;
2. PHP 支持多版本 包括php5.6、 php7.1、php7.2、php7.3、php7.4、php8.0、php8.1 版本;
3. MySQL 支持 5.7 、8.0 版本;
4. Redis 支持 4.0 、5.0 、6.0 版本;
5. MongoDB 支持 4.4 版本;
6. ElasticSearch 和 Kibana 是 7.17.0 版本;
7. PHP 扩展包括了gd、grpc、redis、protobuf、memcached、swoole等;
5. ElasticSearch 和 Kibana 是 7.17.0 版本;
6PHP 扩展包括了gd、grpc、redis、protobuf、memcached、swoole等;

### 一. [install docker](https://github.com/ogenes/docker-lnmp/wiki/Docker-%E7%AE%80%E4%BB%8B%E5%8F%8A%E5%AE%89%E8%A3%85)

Expand Down Expand Up @@ -33,7 +32,7 @@ $ cp .env.example .env
### 四. run
```shell script
#首次执行耗时较久,耐心等待
$ docker-compose up -d nginx php mysql redis
$ docker-compose up -d nginx php74 mysql redis
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ba864491ac22 docker-lnmp_mysql "docker-entrypoint.s…" 22 minutes ago Up 6 seconds 0.0.0.0:3306->3306/tcp, 33060/tcp mysql
Expand All @@ -57,12 +56,11 @@ $ docker-compose restart nginx

### 六. note
默认版本为:
PHP 7.4
MySQL 5.7
Redis 5.0
可以通过修改 env 文件的 PHP_VERSION 、MYSQL_VERSION 、REDIS_VERSION 来选择其他版本
可以通过修改 env 文件的 MYSQL_VERSION 、REDIS_VERSION 来选择其他版本
MySQL 和 Redis 切换版本时,注意切换配置文件

项目目录默认为 docker-lnmp/www 目录
可以通过修改 env 文件的 WEB_ROOT_PATH 来指定其他目录

Expand Down
Loading

0 comments on commit 8b4ec79

Please sign in to comment.