Intended to just be a simple docker starter for starting a new Laravel project.
It utilises official docker images with docker-compose.
See docker-compose.yml
and docker/Dockerfile
to see whats going on under the hood.
nginx:stable-alpine
mysql
php:7.4-fpm
- Create a Laravel project.
composer create-project laravel/laravel src
, or clone the latest git project from Laravel into a new folder calledsrc
. - Copy our env example
cp ./.env.example
to./src/.env
. Open and edit MYSQL details, specifically username, database and password as you require. - Now build our docker image and spin up.
docker-compose build
docker-compose up
- Next install composer packages and generate a key for Laravel:
composer install
php artisan key:generate
- Finally open up http://localhost
Steps you can repeat whenever you need to build or re-launch your site.
docker-compose build
docker-compose up