Giter VIP home page Giter VIP logo

dockerphp's Introduction

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

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

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

segmentfault参考链接

PHP配置图

##创建目录

###基础目录

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

###从代码仓库构建

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

##创建这些目录

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

##下载镜像及构建

cd ~/dvwa/htdocs/dvawfiles
make pull
make dl
make build

##下载代码

cd ~/dvwa/htdocs
git clone https://github.com/MarkThink/DVWA.git dvwa_app

##IDE调试配置

IDE配置一

IDE配置二

##绑定域名

sudo vi /etc/hosts

192.168.99.100	www.dvwa.com

https://www.arroyolabs.com/2016/10/docker-xdebug/

docker-xdebug

Example of how to integrate Docker with xdebug on clean Erdiko example

Quick Start

With current settings you will need to create an alias with static IP on Linux:

sudo ip addr add 10.254.254.254/24 brd + dev eth0 label eth0:1

if you're running OS X:

sudo ifconfig en0 alias 10.254.254.254 255.255.255.0

Go to xdebug_56/docker and run docker-compose up, and voila, a pristine Erdiko project up and running.

To browse it go to http://localhost:8088/

for xdebug Client setup & alternate configuration please refer to:

http://blog.arroyolabs.com/2016/10/docker-xdebug/

###Happly Enjoy!

dockerphp's People

Contributors

brucehex avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.