https://www.murach.com/shop/murach-s-php-and-mysql-2nd-edition-detail
- Open a terminal and browse to a project folder containing
index.php. - Copy
docker/docker-compose.ymlto your php/mysql project directory containing - Update the database connection string to be
mysql:host=db;dbname=my_guitar_shop1 - Run commands
docker-compose up- Browse to http://localhost/
- Make edits on your host and refresh the page to see changes.
- Use
CTRL-Cto stop the containers. - Use
-dflag to run in the background.
docker-compose down- Removes containers and networks.
- Use
--volumesflag to also delete volumes
- Open a terminal and browse to a location containing
index.php - Run commands
docker run -p 80:80 -v "$PWD":/var/www/html php:apache- Browse to http://localhost/
- Make edits on your host and refresh the page to see changes.
- Use
CTRL-Cto stop the container. - Use
-dflag to run in the background.
docker ps -a
docker container prune- Use
ps -ato view all containers pruneremoves stopped containers