This repository contains exercises and examples for learning Docker. Here you may get an example about php-app in this branch where you may use PHP, Composer, MySQL, PHPMyAdmin, Redis, NodeJS, and Nginx server. You may work with Laravel, WordPress, and more.
- Docker installed on your machine
- Basic knowledge of command line interface
-
Clone the repository:
git clone https://github.com/abdulmajidcse/docker-practice.git cd docker-practice git checkout php-app
Or directly clone this branch
git clone --branch php-app https://github.com/abdulmajidcse/docker-practice.git cd docker-practice
-
Run this command to start your development server:
docker-compose up -d
-
You may run this command when you need to rebuild container:
docker-compose up -d --build
-
You may run php, node, npm, or composer command via exec or open your container from Docker.
docker-compose exec <service_name> <command>
For example:
docker-compose exec app php artisan --version docker-compose exec app composer --version docker-compose exec app node --version docker-compose exec app npm --version
-
For starting your application, visit to http://localhost/
-
For phpmyadmin, visit to http://localhost:8080/
-
You may run this command to stop your container.
docker-compose stop