Skip to content

Instantly share code, notes, and snippets.

@wataridori
Last active August 10, 2021 17:04
Show Gist options
  • Save wataridori/5eed8c76cd6120b609d30d21f0785d45 to your computer and use it in GitHub Desktop.
Save wataridori/5eed8c76cd6120b609d30d21f0785d45 to your computer and use it in GitHub Desktop.
Running Laravel Quick Start Project easily using Docker
git clone [email protected]: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