当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 21

shgzhou / docker-lnp
暂停

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

docker-lnp 是一个封装了 Nginx+php7-fpm 以及多数常用的 php 扩展的 Dockerfile 仓库,旨在快速构建基于Docker的LNMP环境。

特性:

  • 1,自定义 Nginx, PHP-FPM, PHP 相关配置文件,完全定制
  • 2,Docker 内采用 supervisor 管理 Nginx,FPM 进程,方便内部重启调试,统一管理
  • 3,通过设置环境变量 SERVER_NAME 可自定义镜像中 nginx 虚拟机的 server_name
  • 4,通过设置环境变量 DOCUMENT_ROOT 可自定义镜像中 nginx 虚拟机的 root
  • 5,直接在 Dockerfile 中通过 RUN 命令执行 shell 命令来控制系统设置
  • 6,通过 docker-compose 控制整个容器环境,可深度定制
  • 7,Nginx采用官方stable-alpine稳定版,容器体积小且稳定
  • 8,PHP版本跟随清华镜像源,升级更方便
  • 9,代码简单,通俗易懂,流程清晰

版本说明:

  • Alpine: 3.5
  • PHP: 7.1
  • Nginx: 1.12.1
  • Docker-compose: 3

使用方式:

step1 构建镜像

cd <docker-lnp dir>

sudo docker-compose build

这里可能得需要一段时间,因为需要下载一些需要的包

step2 查看镜像

sudo docker images

如果没有错的话,上面的命令会显示出来刚刚构建好的镜像

step3 运行镜像

sudo docker-compose up -d
  • -d 指定后台运行,也可以省略,则容器运行在前台

step4 测试

sudo docker ps
sudo docker inspect <container_id>

通过上面的命令找到映射IP,然后在本地通过IP或配置hosts文件来访问,注意代码位置需要通过Dockerfile中的卷映射出来

step5 调试,如果需要的话

sudo docker ps
sudo docker exec -it <container_id> bash

容器内部的Alpine linux系统提供一个bash环境,可进入到系统内部方便调试环境,重启则可通过 supervisorctl

说明

  • 该仓库的Dockerfile仅封装了Nginx和FPM,不包含Mysql
  • 建议通过 docker-compose 来定义容器环境,详细请参考 docker-compose.yml 文件
  • 该仓库提供的 docker-compose.yml 中定义了容器链接 Mysql 的方式,如有需要请参考

最后: 欢迎提建议指正,不定时更新中。。。。。By Koma > komazhang@foxmail.com

The MIT License (MIT) Copyright (c) 2017 Koma 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.

简介

封装了Nginx+php7-fpm的Dockerfile仓库 展开 收起
Docker
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Docker
1
https://gitee.com/shgzhou/docker-lnp.git
git@gitee.com:shgzhou/docker-lnp.git
shgzhou
docker-lnp
docker-lnp
master

搜索帮助

14c37bed 8189591 565d56ea 8189591