Deploy lnmp(Linux, Nginx, MySQL, PHP7) using docker.
I want to share my ideas and designs about Web-Deploying using Docker with you.
The whole app is divided into three Containers:
Nginx
Container, which handles requests and makes responses.PHP-FPM
Container, it retrieves php scripts from host, interprets, executes then responses to Nginx. If necessary, it will connect to MySQL
as well.MySQL
Container,Our app scripts are located on host, you can edit files directly without rebuilding/restarting whole images/containers.
At first, you should have had Docker and Docker Compose installed.
Without building images one by one, you can make use of docker-compose
and simply issue:
$ sudo docker-compose up
For more operations to containers, please refer to:
$ sudo docker-compose --help
Check out your https://<docker-host> and have fun
###注:
代码放到 /data/www目录下, nginx的配置放到 /data/nginx/conf.d/ 目录下,参考defult.conf 直接运行start.sh就好啦。要想开启ssl模式,把default.conf第3到第8行注释去掉方可开启localhhost的https了,其它类似。
Micooz micooz@hotmail.com
sndnvaps sndnvaps@gmail.com
MIT
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。