1 Star 0 Fork 0

当时只道是寻常 / docker_php

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

dnmp

Docker deploying Nginx MySQL PHP7 in one key, support full feature functions.

Demo Image

1. Feature

  1. 完全开源的.
  2. PHP7.2
  3. 本地配置 php nginx .
  4. 本地查看 日志文件.

2. Usage

  1. 下载 git, dockerdocker-compose;
  2. 克隆项目:
    $ git clone https://github.com/yeszao/dnmp.git
  3. 启动docker容器:
    $ cd dnmp
    $ docker-compose up
    可能需要root 权限 sudo .
  4. 在浏览器输入localhost:

Demo Image

文件路径 ./www/site1/.

3. PHP版本切换?

默认更新在 docker_php 下的

$ docker-compose up

已删除 可以在 git clone https://github.com/yeszao/dnmp.git 源码

$ docker-compose -f docker-compose54.yml up
$ docker-compose -f docker-compose56.yml up

注意: 我们只可以启动一个版本 他们使用的是一个端口 如果想切换版本 先关闭运行版本

4. HTTPS and HTTP/2

默认两个站点

更改虚拟域名 ( /etc/hosts Linux 和 C:\Windows\System32\drivers\etc\hosts Windows):

127.0.0.1 www.site1.com
127.0.0.1 www.site2.com

可以在浏览器中访问

5. 日志的使用

We can identify log directory in nginx / php / php-fpm / mysql config file. To display the log file in host, we should config them to /var/log/dnmp.

但是 它们有一些不同

5.1 Nginx 日志

Nginx 将自动生成所有日志文件。

5.2 PHP-FPM 日志

php-fpm 必须要手动创建 (in host):

$ touch log/php.fpm.error.log
$ chmod a+w log/php.fpm.error.log

5.3 MySQL log

php-fpm 一样 必须要手动创建(in host):

$ touch log/mysql.slow.log
$ chmod a+w log/mysql.slow.log
MIT License Copyright (c) 2017 Gary Meng Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

PHP + Nginx docker 部署 展开 收起
PHP
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/lideqiang/docker_php.git
git@gitee.com:lideqiang/docker_php.git
lideqiang
docker_php
docker_php
master

搜索帮助

14c37bed 8189591 565d56ea 8189591