Setup nginx, mysql, memcached & php env by docker
- php 7.1
- nginx latest version
- mysql 5.7.23
- Download this repo into your local machine
$ git clone git@github.com:moitran/php-docker-env.git- Run script to build & start all containers by this command (If you already installed mysql in your local machine & it is using port 3306, please stop it before run this command)
$ ./bin/run.sh
- In this repo has two example projects (you can remove it and replace by your repositories):
- ./www/site1/ this one will use ./etc/nginx/site1.conf
- ./www/site2/ this one will use ./etc/nginx/site2.conf
Now, Open your browser and go to:
-
localhost:8080 you will see:
Connected successfully Site1 -
localhost:8081 you will see:
Connected successfully Site2
Well Done!!!!
- Source code structure
βββ bin
β βββ run.sh Run all docker containers
β βββ down.sh Stop all docker containers
βββ etc
β βββ dbScripts You can put all sql dump script into this folder. It will be automatic to run when start mysql container.
β βββ nginx Nginx conf files
β βββ php php.ini config files
βββ logs All error.log & access.log of nginx will sync into this folder
βββ mysql Mysql container
βββ nginx NGINX container
βββ php PHP container
βββ www Put all php projects into this folder
βββ docker-composer.yml
This source code is under MIT License