{"id":16314700,"url":"https://github.com/liufee/docker","last_synced_at":"2025-03-16T14:30:50.465Z","repository":{"id":181142036,"uuid":"58803527","full_name":"liufee/docker","owner":"liufee","description":"最新lnmp环境，包含php, java,nginx, mysql, go, node, mongodb, openssh server, redis, crond xhprof,maven等服务","archived":false,"fork":false,"pushed_at":"2019-10-30T01:24:47.000Z","size":85,"stargazers_count":125,"open_issues_count":0,"forks_count":48,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-27T10:09:24.601Z","etag":null,"topics":["docker","docker-compose","docker-image","docker-lnmp","docker-mysql","docker-php","lnmp"],"latest_commit_sha":null,"homepage":"http://demo.cms.feehi.com","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liufee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-14T11:02:53.000Z","updated_at":"2025-02-19T14:23:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"3934c6e5-9161-49ea-8d32-19291704008b","html_url":"https://github.com/liufee/docker","commit_stats":null,"previous_names":["liufee/docker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liufee%2Fdocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liufee%2Fdocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liufee%2Fdocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liufee%2Fdocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liufee","download_url":"https://codeload.github.com/liufee/docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243818192,"owners_count":20352629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","docker-image","docker-lnmp","docker-mysql","docker-php","lnmp"],"created_at":"2024-10-10T21:55:03.308Z","updated_at":"2025-03-16T14:30:50.448Z","avatar_url":"https://github.com/liufee.png","language":"Dockerfile","readme":"LNMP Dockerfile\n=================\n\n基于最新版CentOS官方镜像\n\n包含php, java, nginx, mysql, reids, openssh server, go, crond, swoole, mongodb, adminMongo, node.js, phpmyadmin, phpredisadmin, xhprof, maven等服务。\n\n\n简介\n------------------------\n默认包含的版本\n\n- [x] php (默认7.2.8)\n\n- [x] java (默认1.8,当前仅支持1.8)\n\n- [x] nginx (默认1.15.2版本,默认web根目录在/usr/local/nginx/html)\n\n- [x] mysql (默认5.7.23)\n\n- [x] redis（默认4.0.11版本,默认密码123456）\n\n- [x] openssh server (默认root密码123456)\n\n- [x] crond\n\n- [x] phpmyadmin (默认版本4.7.6, 管理地址: http://nginx默认站点或域名/phpmyadmin)\n\n- [x] phpredisadmin (管理地址::http://nginx默认站点域名或ip/phpredisadmin。管理用户名为admin，密码同redis密码)\n\n- [x] xhprof\n\n- [x] go语言 (默认1.13 GOPATH环境变量已设置为$HOME/go,映射到此文件夹即可。1.11版本后开启vgo映射任何目录均可)\n\n- [x] node.js (默认10.16.3)\n\n- [x] mongodb (默认4.0.1)\n\n- [x] adminMongo (管理地址: http://nginx默认站点域名或ip/adminMongo。默认没有密码，且设置为中文)\n\n- [x] maven (默认3.6.2)\n\n\n\u003edocker build的时候加入\n    --build-arg PHP_VER=php版本号 \n    --build-arg JKD_VER=jdk版本号 \n    --build-arg NGINX_VER=nginx版本号 \n    --build-arg MYSQL_VER=mysql版本号 \n    --build-arg REDIS_VER=reids版本号\n    --build-arg PHPMYADMIN_VER=phpmyadmin版本号\n    --build-arg REDIS_VER=redis密码(phpredisadmin同此)\n    --build-arg ROOT_PASSWORD=ssh的root密码\n    --build-arg GO_VER=go语言版本\n    --build-arg NODE_VER=node.js语言版本\n    --build-arg MONGODB_VER=mongodb版本\n    --build-arg MAVEN_VER=maven版本\n可以指定php，nginx，redis，phpmyadmin的安装版本, redis(phpredisadmin)和ssh的密码\n\n\n获取镜像\n------------------------\n1. 远程获取镜像(推荐)\n    ```bash \n    $ git clone https://github.com/liufee/docker.git\n    $ cd /path/to/docker\n    $ docker pull registry.cn-hangzhou.aliyuncs.com/liufee/feehi \n    ```\n   P.S虽然通过远程获取仓库获取镜像，但是还是建议clone本仓库到本地，因为docker run容器时-v挂载目录把配置文件映射进去\n    \n2. 自行构建\n    ```bash\n    $ git clone https://github.com/liufee/docker.git\n    $ cd /path/to/docker\n    $ docker build -t liufee/feehi ./\n    ```\n    P.S \n    \n    自行构建，如果某一步骤失败, 再来一次。(因为你懂的原因，pecl.php.net,phpmyadmin.net,repo.mysql.com不稳定，造成下载某些扩展的时候失败退出。windows下使用ss代理切记勾选全局使用代理并重启cmd)\n    \n    强烈建议在执行cd /path/to/docker命令前，执行export http_proxy=http://ip:1087;export https_proxy=http://ip:1087;伟大的GFW，最好带个梯子。ip通常为127.0.0.1\n\n\n运行容器\n-------------------\n\n```bash\n  $ docker run -h feehi -p 80:80 -p 23:22 -p 3306:3306 -p 6379:6379 -p 27017:27017 --name feehi -itd -v /path/to/docker/etc/nginx:/etc/nginx -v /path/to/docker/data/mysql:/data/mysql -v /path/to/docker/data/mongodb:/data/mongodb -v /path/to/docker/data/log:/var/log -v /path/to/default-nginx-website:/usr/local/nginx/html -v /your-work-directory:/your-work-directory liufee/feehi\n```\n P.S \n \n 若使用远程获取镜像请将liufee/feehi修改成registry.cn-hangzhou.aliyuncs.com/liufee/feehi\n 默认web目录为/usr/local/nginx/html,若需要配置多个vhost可以映射其他web目录进去.如: -v /path/to/sites:/www,然后在/etc/nginx/site.d中增加vhost配置\n\n\nxhprof使用方法\n-------------------\n```php\n    xhprof_enable();\n\n    //你需要分析的代码\n    \n    $xhprof_data = xhprof_disable();\n    include_once 'xhprof_lib/utils/xhprof_lib.php';//注xhprof_lib已经在/usr/local/php/lib/php中了\n    include_once 'xhprof_lib/utils/xhprof_runs.php';\n    \n    $xhprof_runs = new XHProfRuns_Default();\n    $run_id = $xhprof_runs-\u003esave_run($xhprof_data, \"xhprof_test\");\n    //将run_id保存起来或者随代码一起输出\n```\n然后访问:http://nginx默认站点或域名/xhpfrof_html/index.php?run=run_id\u0026source=xhprof_test查看结果\n\n\n注意\n-------------------\n* 为了持久化保存数据，最好把宿主机某一目录挂载到容器内的/mysql。\n* 每次启动容器的时候，都会判断/mysql目录是否为空，为空则初始化mysql服务并修改root密码为docker run -e MYSQL_PASSWORD=xxx的值，若没有指定默认修改为123456, host='%'，需要重置mysql直接清空/mysql目录重新启动容器即可。\n\n   \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliufee%2Fdocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliufee%2Fdocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliufee%2Fdocker/lists"}