On your local machine, clone this repo:
git clone https://github.com/khadka7/laravel-docker.git
cd laravel-docker
rename .env.example with .env or add .env
Then build and run the documentation with Docker Compose
docker-compose up -d --build
Docker Compose is included with Docker Desktop. If you don't have Docker Compose installed, follow these installation instructions.
Once the container is built and running, visit http://localhost:9000 in your web browser to view the docs.
To stop the staging container, use the docker-compose down
command:
docker-compose down
To start the staging container again, use the docker-compose up -d
command:
docker-compose up -d
- You need to install dependencies in you local machine.
docker-compose exec app composer install docker-compose exec app php artisan key:generate docker-compose exec app php artisan optimize:clear
In windows if
docker-compose exec
commands doesnt run in terminal or git bash try using powershell.
- use either
docker-compose exec app sh
- or
docker-compose exec app bash
then you can use commands command without having to execute
docker-compose exec app ${YOUR_COMMAND}