- install and run docker to your local computer https://www.docker.com/get-started
- copy all files from laravel-docker folder to inside your laravle project.
- rename .env.docker to .env
-
For the first time, build the project [from second time build is not required]
docker-compose build
-
Run the project
docker-compose up
Now our project is running you can access app from web browser by http://localhost/
If you run the project for the first time you also have to follow the below instructions -
install required composer packages
docker exec -it app composer install
-
install node packages
docker exec -it app npm install
-
migrate databases
docker exec -it app php artisan migrate
-
seed generate (optional)
docker exec -it app php artisan db:seed
-
To open a container shell
docker exec -it container_name sh
Example: if you want to access mysql(container) shell
docker exec -it mysql sh
-
database access
first access the mysql shell then run the below command
mysql -uroot -pboos