Coder Social home page Coder Social logo

linux-php7-redis-mysql-docker's Introduction

nginx-php7-mysql5.7 docker-compose

包含内容如下:

  • alpine v3.8
  • nginx v1.14.0
  • php v7.2.10
  • mysql v5.7
  • redis v4.0.11

构建及运行方式

#将自定义的虚拟主机配置文件和证书文件放在指定目录中
#然后根据 docker-compose.yml 文件构建docker镜像,执行以下命令
docker-compose build
#拉起docker-compose相关编排镜像,注意相关端口,保证80、443、3306、6379端口没有被占用
docker-compose up -d

其它操作

  • 停止:docker-compose stop
  • 启动:docker-compose start
  • 重启:docker-compose restart
  • 删除:docker-compose rm

目录说明

  • ./web:本地物理路径,映射到docker中的/var/www/目录,web项目存放在此目录
  • ./mysql-data:本地物理路径,映射到docker中的/var/lib/mysql/目录,mysql的数据目录存放于此

其它说明

nginx主docker连接redis和mysql时,直接使用redis和mysql这两个名称即可,mysql的root密码是root,redis无密码,如:

mysql -h mysql -u root -p
redis-cli -h redis

测试

增加解析 127.0.0.1 docker.test,并测试域名

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.