Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuanpht/b6ec4173209d65ac02cf58c5b65751af to your computer and use it in GitHub Desktop.
Save tuanpht/b6ec4173209d65ac02cf58c5b65751af to your computer and use it in GitHub Desktop.
Running Laravel Quick Start Project easily using Docker
git clone git@github.com:laravel/quickstart-basic.git
cd quickstart-basic
// You can download docker-compose.yml file using wget command
wget https://raw.githubusercontent.com/FramgiaDockerTeam/laravel-microservices/master/docker-compose.yml
  • Open .env file and change the DB_HOST and REDIS_HOST
...
// DB_HOST=127.0.0.1
DB_HOST=mysql
...
// REDIS_HOST=127.0.0.1
REDIS_HOST=redis
  • chmod folder storage and bootstrap/cache
chmod -R 777 storage
chmod -R 777 bootstrap/cache
  • Run docker and wait for about one minute
docker-compose up -d
// Run the following command to check docker status
docker ps
  • Enter workspace container and run php commands (run only once when initialize the project)
docker exec -it project_workspace bash
composer install
php artisan migrate
  • Enjoy the project at http://localhost:8000/
  • To stop project, use docker-compose down. To start project, use docker-compose up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment