This project is a PHP 7 docker environment with Mysql and Nginx instance. In addition, the docker environment install globally PHPunit 7.1 and Composer(https://getcomposer.org/)
First of all, it is helpful to run php and installs dependencies avoiding conflicts with other php projects. The second reason, it is to make your local machine clean
After you've clone this project, follow the steps:
- open a terminal session in your terminal tool (Iterm, Terminal, Putty)
- go to folder where you've clone the project (Ex.:
cd docker-compose-for-php7-nginx-mysql
) - type the command:
make run
when you run make run
in the first time, the docker image will be created. In the next times, docker compose will use the image.
make mysql
: use this command to enter in mysql console. This command must be typed in a new termina session, in other words, you must keep alive the session where you've runmake run
make console
: use this command to enter in container where php-nginx is running. This command must be typed in a new termina session, in other words, you must keep alive the session where you've runmake run
make destroy
: use this command to destroy the project. To use this command, to to the terminal session where you've runmake run
and press CTRL+C. After that, typemake destroy
=> I already have a php project. How can I use this docker container?
A: Pretty simple. Clone this docker container project and copy the files Dockerfile, docker-compose.yml and Makefile, and paste them inside your php root path. After that, type the command: make run
.
=> I'm having problems to up the container or run rails project. What can I do ? A: create a github issue . I promise will answer as soon as possible