Local hosting with Docker environment with NGINX, PHP, MySQL.
root_password = root
user = db
db_password= db
- Shared projects folder should be located at
home/$USER/Projectselse you have to editdocker-compose.ymlto set your projects path within thenginxsection. - Use
dmesg | docker inspect nginx | egrep '"IPAddress": "172\.[0-9]{1,3}\.[0-9]{1,2}\.[0-9]"'to get your docker ip address and then add it to your hosts. - A
home/$USER/Projects/htmlfolder is needed in orderphp-appto start correnctly. - If you want to avoid typing
sudowhenever you run thedockercommand, add your username to thedockergroup:sudo usermod -aG docker ${USER}.
- On Linux/Mac
sudo vim /etc/hosts - If you are on Windows, you can find instructions for altering your hosts file here.
- On Linux use
sudo sysctl -w vm.max_map_count=262144to give to the elastic search container enought memory to start. To make this change permanent you have to addvm.max_map_count=262144to your/etc/sysctl.confas root.
Your hosts file on Linux should look like this
#<ip-address> <hostname.domain.org> <hostname>
0.0.0.0 localhost.localdomain localhost
10.5.0.4 example.com
10.5.0.5 example.com
10.5.0.6 example.com
10.5.0.7 example.com
::1 localhost.localdomain localhost
- Version: 1.7.3
- Version: 7.1.6
- Version: 5.7.18
- Version: 1.12.0
/etc/nginxis linked with the./nginxfolder so any change configurations are done in the./nginxfolder.