Skip to content

moitran/php-docker-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

php-docker-env

Setup nginx, mysql, memcached & php env by docker

Containers version

  1. php 7.1
  2. nginx latest version
  3. mysql 5.7.23

How to use

  1. Download this repo into your local machine
$ git clone git@github.com:moitran/php-docker-env.git
  1. 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
  1. 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!!!!

  1. 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

License

This source code is under MIT License

About

Setup nginx, mysql & php env by docker

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published