- Docker
- Dockerfile with Alpine
- Nginx
- Laravel 11
- MySQL
- PHP 8.2
- Node
- NPM
- PHP Prettier
- Github Action To Run Prettier Check
- Github Action To Run PHP Unit Test
Follow the instructions below to set up your project.
- Download and Install Docker
- By Clicking Use This Template Button or You can Click Here
make run-app-with-setup
: build docker and start all docker containers with Laravel setupmake run-app-with-setup-db
: build docker and start all docker containers with Laravel setup + database migration and seedermake run-app
: start all docker containermake kill-app
: kill all docker containermake enter-nginx-container
: enter docker nginx containermake enter-php-container
: enter docker php containermake enter-mysql-container
: enter docker mysql containermake flush-db
: run php migrate fresh commandmake flush-db-with-seeding
: run php migrate fresh command with seedingmake code-format-check
: run npm command to run prettier to check your codemake code-format
: run npm command to run prettier to format your codemake code-test
: run php artisan test command
- Create .env file for the Laravel environment from .env.example on src folder
- Run command
docker-compose build
on your terminal - Run command
docker-compose up -d
on your terminal - Run command
composer install
on your terminal after going into the php container on docker - Run command
docker exec -it php /bin/sh
on your terminal - Run command
chmod -R 777 storage
on your terminal after going into the php container on docker - If app:key still empty on .env run
php artisan key:generate
on your terminal after going into the php container on docker - To run artisan commands like migrate, etc. go to php container using
docker exec -it php /bin/sh
- Go to http://localhost:8001 or any port you set to open Laravel
- If you encounter a permission error when running Docker, try running it as an administrator or using
sudo
in Linux. - Check the summary of new features in Laravel 11 here or on the official page here.
- Right now, I will postpone upgrading to PHP 8.3 because the PHP Plugin in Prettier is not supported yet. Check the issues here.
- Don't forget to run
npm run format
inside your php container or runmake code-format
before you push your code. - Don't forget to run
php artisan test
inside your php container or runmake code-test
before you push your code.