This is a docker based LAMPP like environment, based on 3 containers:
- web-server (CentOS 7, Apache 2.4, PHP 7.2)
- mysql-server (MariaDB 10.5.9)
- pma-server (phpMyAdmin 5.0.1)
git clone https://github.com/theqdev/docker-lampp-env.git
cd docker-lampp-env
docker-compose up -d
Place your code under html
directory. The web server is available at http://localhost:8080.
You can access your web-server by SSH-ing into it using the following command:
docker exec -it web-server /bin/bash SSH into container
The PMA container can be accessed at http://localhost:5000. For larger imports you can place your mysql export files in the mysql
directory then import using something like this:
docker exec -it mysql-server /bin/bash SSH into container
cd /home/mysql
mysql -u root -p my_database < DatabaseBackup.sql
You can find the default mysql credentials below:
mysql_host:mysql-server
mysql_user:root
mysql_pass:secret
docker ps
List containers and their statedocker logs -f web-server
Get container logsdocker ps -a -q | ForEach { docker stop $_ }
Stop all containersdocker exec -it web-server /bin/bash
SSH into containerdocker rm -f $(docker ps -aq)
Remove all containersdocker-compose up -d --build
Rebuild containers in the background
Note* If ran on Windows, try to make sure you run both your docker instance + terminal as administrator, to avoid any weird issues.