A docker-compose of LEMP stack, separated on multiple containers.
Linux + NGINX(Engine-X) + MariaDB(MySQL fork) + PHP7
-
Install Docker Compose.
https://docs.docker.com/compose/install/ -
Clone this repository.
$ git clone https://github.com/preechaim/docker-lemp.git
-
Edit
docker-lemp/docker-compose.yml
to assign your MySQL root password and new user -
Start server for the first time.
$ cd docker-lemp
$ docker-compose up -d
Test the server by opening your web browser to http://localhost
or http://YOUR_SERVER_IP
- Make the server to auto start at boot. (for Linux)
Open crontab file
$ crontab -e
Add a new line to the file.
@reboot cd ~/docker-lemp && /usr/local/bin/docker-compose up -d
Save, exit and reboot.
$ sudo reboot
- html: Web server root
- conf: Contains configuration files
- mysql: Contains MySQL database files (create on first run)
- logs: Contains NGINX logs (create on first run)