Docker容器化PHP开发环境搭建-DVWA (含xdebug调试)

WBOY
Release: 2016-06-23 13:15:27
Original
1089 people have browsed it

Docker容器化技术在过去的2015年得到了大面积的普及应用,特别是以灵雀云、数人云、阿里云以及阿里百川TAE2.0等为代表的服务商的推动,可以预见2016会是云服务大爆发的一年,会有越来越多的互联网企业将自己的业务部署到基于Docker容器的环境里来。

本文以 DVWA 部署为例,来讲解PHP环境部署+基于XDEBUG调试环境的容器化解决方案。

Github代码

segmentfault参考链接

创建目录

基础目录

  • ~/dvwa/data 存放MySQL数据库
  • ~/dvwa/htdocs 项目代码
  • ~/dvwa/log 存放所有输出log

从代码仓库构建

cd ~git clone https://github.com/MarkThink/DockerPHP.git dvwa
Copy after login

创建这些目录

mkdir ~/dvwa ~/dvwa/data ~/dvwa/data/mysql ~/dvwa/log ~/dvwa/log/nginx ~/dvwa/log/php ~/dvwa/htdocs

下载镜像及构建

cd ~/dvwa/htdocs/dvawfilesmake pullmake dlmake build
Copy after login

下载代码

cd ~/dvwa/htdocsgit clone https://github.com/MarkThink/DVWA.git dvwa_app
Copy after login

IDE调试配置

绑定域名

```

sudo vi /etc/hosts

192.168.99.100 www.dvwa.com

```

Happly Enjoy!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template