3.4 KiB
Overview
Install prerequisites
This project has been created for (Linux/MacOS).
All requisites should be available for your distribution. The most important are :
Check if docker-compose is already installed by entering the following command :
which docker-compose
On Ubuntu and Debian these are available in the meta-package build-essential. On other distributions, you may need to install the GNU C++ compiler separately.
sudo apt install build-essential
This project use the following ports :
| Server | Port |
|---|---|
| MySQL | 3306 |
| PHPMyAdmin | 8080 |
| Nginx | 80 |
Clone the project
To install Git, download it and install following the instructions :
git clone https://github.com/nanoninja/docker-nginx-php-mysql.git
Go to the project directory :
cd docker-nginx-php-mysql
Configure Nginx With SSL Certificates
You can change the host name by editing the .env file.
If you modify the host name, do not forget to add it to the /etc/hosts file.
-
Configure Nginx
Do not modify the
Website/etc/nginx/default.conffile, it is overwritten byWebsite/etc/nginx/default.template.confEdit nginx file
Website/etc/nginx/default.template.confand uncomment the SSL server section :# server { # server_name ${NGINX_HOST}; # # listen 443 ssl; # fastcgi_param HTTPS on; # ... # }
Run the application
-
Start the Docker application :
sudo make startPlease wait this might take a several minutes...
sudo make logs # Follow log output -
Clone the required git repositories:
sudo make clone -
Import the required databases:
sudo make import -
Open your favorite browser :
- http://localhost
- http://localhost:8080 PHPMyAdmin (username: root, password: root)
-
Backup your databases:
sudo make backup -
Restore your databases:
sudo make restore -
Get help:
sudo make help -
Stop the application:
sudo make stop
Additional commands
| Name | Description |
|---|---|
| clone | Clone the git repository folders |
| pull | Get the latest git repository updates |
| start | Create and start containers |
| stop | Stop all containers |
| restart | Restart all containers |
| logs | Display log output |
| import | Import all databases from git repositories |
| backup | Create backup of all local databases |
| restore | Restore backup of all local databases |
| flush | Delete local git repository folders |