GithubHelp home page GithubHelp logo

davidfang / docker-compose-nginx-php-mysql Goto Github PK

View Code? Open in Web Editor NEW

This project forked from foxiswho/docker-compose-nginx-php-mysql

0.0 1.0 0.0 25 KB

docker-compose+nginx+php+mysql+redis+elasticsearch

License: MIT License

Shell 100.00%

docker-compose-nginx-php-mysql's Introduction

docker-compose-nginx-php-mysql

docker-compose+nginx+php+mysql+redis+elasticsearch

版本

Mac系统

php:5.6.x php:7.x

mysql:5.6.x mysql:5.7.x

nginx:latest

elasticsearch:latest

Mac系统 安装方式

1.选择要安装的系统和版本

例如:mac系统 php5.6.x版本,进入mac-php56目录

cd mac-php56

2.docker-compose.yml配置更改

选择你需要的功能,不需要的用#号注释掉

3.生成镜像

这个时候 一定不能更换目录。

注意 如果你以前已经配置过一样的容器那么会自动覆盖容器

docker-compose up

时间比较长, 更新源都在国外,最好早晨拉取

nginx

配置文件位置:/etc/nginx/nginx.conf

来源:官方源

php

来源:官方源

php-fpm

配置文件及目录位置

/usr/local/etc/php-fpm.conf

/usr/local/etc/php-fpm.d/www.conf

/usr/local/etc/php-fpm.d 目录

##php.ini 默认加载目录位置 /usr/local/etc/php/conf.d/ 目录

redis

来源:官方源

elasticsearch

来源:官方源

使用教程-MAC系统

新建目录

/Volumes/work/vhost/

Volumes: MAC系统 卷 硬盘名称都会显示在里面

work:分区名称

wwwroot:自定义目录,默认目录

vhost:nginx 站点配置文件

复制 nginx/default.conf/Volumes/work/vhost/ 目录下

1.mac硬盘设置

mac 系统默认硬盘 不区分大小写,

如果需要区分请 按 http://blog.csdn.net/fenglailea/article/details/53083785 此链接中教程 重新分区。

建议分区,我这里是分区的

2.nginx 配置

进入nginx容器

docker exec -it compose_nginx_1 bash

compose_nginx_1 容器名字可能不一样 配置nginx.conf

vim /etc/nginx/nginx.conf

找到如下配置

include /etc/nginx/conf.d/*.conf;

修改为:(根据你自己分区名称置修改)

include /Volumes/work/vhost/*.conf; 

保存和退出容器

3.php 配置

跟nginx类似

5.测试

/Volumes/work/wwwroot/ 目录下 新建 index.php

<?php
phpinfo();
X.问题

X.1 权限问题 设置 可读写执行权限

chmod -R 777 /Volumes/work/wwwroot

更改下载镜像名称

下载镜像和容器前缀名称是根据当前项目目录名设置的。 例如当前项目目录为mac-php56,那么镜像和容器的前缀名为 macphp56

docker-compose-nginx-php-mysql's People

Contributors

foxiswho avatar

Watchers

 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.