Docker deploying Nginx Mariadb10.x PHP7.2 in one key, support mysql master/slave replication.
- 一键部署基于Docker的LNMP环境
- 一键部署主从复制Mysql库,实现读写分离
- 清晰的目录结构,方便运维
-
Install
git
,docker
anddocker-compose
; -
Clone project:
$ git clone https://github.com/openmore/docker-lnmp.git
-
config your Php web root
$vi conf/nginx/conf.d/site.conf
-
Start docker containers:
$ docker-compose up
You may need use
sudo
before this command in Linux. -
deploy Mysql master/slave replication
$ ./mysql_replication.sh
-
project hierarchy
+- conf/ + - mysql/ mysql conf + - master/ + my.cnf master db conf + - slave/ + my.cnf slave db conf + my.cnf + - nginx/ + - conf.d/ + site.conf nginx conf + nginx.conf + - php/ +- log/ + - mysql/ + - master/ + - slave/ + - nginx/ + - php-fpm/ +- mysql/ mysql data directory + - master/ + - slave/ +- php/ + - php72/ + Dockerfile + sources.list.stretch +- src/ php project source root + docker-compose.yml + mysql_replication.sh Mysql master/slave replication deploy script