|
1 | 1 | # php-docker-env
|
2 | 2 | Setup nginx, mysql, memcached & php env by docker
|
3 | 3 |
|
4 | | -- [Installation](#installation) |
5 | | -- [Usage](#usage) |
| 4 | +- [How to use](#how-to-use) |
6 | 5 | - [License](#license)
|
7 | 6 |
|
8 | 7 |
|
9 | | -Installation |
10 | | ------------- |
11 | | - |
| 8 | +How to use |
| 9 | +---------- |
| 10 | +1. Download this repo into your local machine |
12 | 11 | ``` bash
|
13 | 12 | $ git clone git@github.com:moitran/php-docker-env.git
|
14 | 13 | ```
|
| 14 | +2. Run script to build & start all container |
| 15 | +``` |
| 16 | +$ ./bin/run.sh |
| 17 | +``` |
| 18 | +3. In this repo have two example projects (you can remove it and replace by your repositories): |
| 19 | + - *./www/site1/* this one will use *./etc/nginx/site1.conf* |
| 20 | + - *./www/site2/* this one will use *./etc/nginx/site2.conf* |
| 21 | + |
| 22 | + Now, Open your browser and go to: |
| 23 | + |
| 24 | + - localhost:8080 you will see: |
| 25 | + |
| 26 | + ``` |
| 27 | + Connected successfully |
| 28 | + Site1 |
| 29 | + ``` |
15 | 30 |
|
16 | | -Usage |
17 | | ------ |
| 31 | + - localhost:8081 you will see: |
| 32 | + |
| 33 | + ``` |
| 34 | + Connected successfully |
| 35 | + Site2 |
| 36 | + ``` |
18 | 37 |
|
| 38 | +Well Done!!!! |
| 39 | + |
| 40 | +4. Source code structure |
| 41 | + |
| 42 | +``` |
| 43 | +├── bin |
| 44 | +│ ├── run.sh Run all docker containers |
| 45 | +│ └── down.sh Stop all docker containers |
| 46 | +├── etc |
| 47 | +│ ├── dbScripts You can put all sql dump script into this folder. It will be automatic to run when start mysql container. |
| 48 | +│ ├── nginx Nginx conf files |
| 49 | +│ └── php php.ini config files |
| 50 | +├── logs All error.log & access.log of nginx will sync into this folder |
| 51 | +├── mysql Mysql container |
| 52 | +├── nginx NGINX container |
| 53 | +├── php PHP container |
| 54 | +├── www Put all php projects into this folder |
| 55 | +└── docker-composer.yml |
| 56 | +``` |
19 | 57 |
|
20 | 58 | License
|
21 | 59 | -------
|
22 | 60 |
|
23 | | -This source code is under [MIT License](https://github.com/moitran/php-docker-env/blob/master/LICENSE) |
| 61 | +This source code is under [MIT License](https://github.com/moitran/php-docker-env/blob/master/LICENSE) |
0 commit comments