Windows 7 builds Docker-based nginx, PHP runtime Environment

Source: Internet
Author: User

Windows 7 builds Docker-based nginx, PHP runtime Environment

包含的软件:nginxphp(可选php 5.*或php 7.*)phpredis扩展(php5.*安装小于2.2.8的版本 php7.*安装>=3.0的版本)
Basic Software Environment
Windows 7Docker Toolbox(自带了VitrualBox虚拟机软件)注意:因为Win10有Docker特别版,此环境只适用于Win7
Installation procedure Brief description
安装好Docker Toolbox,VitrualBox后关闭VitrualBox虚拟机default设置虚拟机default的共享文件夹,固定分配c/Users => E:\work自动挂载 = 是访问权限 = 完全重启虚拟机注意:E:\work是自己的win7代码目录,改为自己机器上的目录进入到虚拟中访问路径说明:Win7中有代码目录 E:\work\php-webapp在虚拟机中的访问路径是 /c/Users/php-webapp在nginx, php容器中Docker compose会将 /c/Users 映射为 /data 目录
Hosts point

Modify C:\Windows\System32\drivers\etc\hosts 192.168.99.100 is a virtual machine IP

192.168.99.100 www.beta.com www.dev.com192.168.99.100 login.beta.com login.dev.com192.168.99.100 api.beta.com api.dev.com192.168.99.100 buy.beta.com buy.dev.com192.168.99.100 static.beta.com static.dev.com192.168.99.100 ex.beta.com ex.dev.com192.168.99.100 exapi.beta.com exapi.dev.com192.168.99.100 api.front.beta.com api.front.dev.com
Enabling the Environment
用git工具下载此项目例如:在 E:\work 执行git命令git clone http://labs.oa.com/tobin/docker-compose.git下载完成后生成目录E:\work\docker-compose双击桌面的 "Docker Quickstart Terminal",启动虚拟机等待启动成功进入docker-compose目录cd /e/work/docker-compose编译docker-compose build启动(-d 是后台运行)docker-compose up -d
Directory File Role Description
 MySQL---------------mysql Dockerfile mysql docker configuration file (not enabled) Nginx---------------nginx Logs-        ------------nginx Log directory vhost------------nginx Multi-domain configuration file api.conf api.dev.com api.beta.com configuration file buy.conf buy.dev.com buy.beta.com configuration file ex.conf ex.dev.com ex.beta.com profile Exapi        . conf exapi.dev.com exapi.beta.com configuration file front.conf front.dev.com front.beta.com profile    static.conf static.dev.com static.beta.com configuration file www.conf www.dev.com www.beta.com profile Dockerfile nginx Docker configuration file nginx.conf nginx configuration file php.conf nginx php-fpm configuration text PHP----------------php-fpm Dockerfile php-fpm 5.* docker configuration file Dockerfile.php7 php-fpm 7.* Docker profile Redis--------------Redis server Dockerfile redis Docker configuration file (not enabled) 

Windows 7 builds Docker-based nginx, PHP runtime Environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.