-
Make a copy of the .env.example
cp .env.example .env
...and fill fields:
DB_CONNECTION=mysql DB_HOST=db DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=laraveluser DB_PASSWORD=your_laravel_db_password DOCKER_PREFIX=skeleton
-
Install composer dependency, run:
sudo usermod -a -G docker $USER #Add permission make composer_dep
-
Set permissions on the project directory so that it is owned by your non-root user:
sudo chown -R $USER:$USER $PWD
-
Set the application key for the Laravel application
make key
-
Optional* >> To cache these settings into a file, which will boost your application's load speed, run:
docker-compose exec app php artisan config:cache
Your configuration settings will be loaded into /var/www/bootstrap/cache/config.php on the container.
-
Creating a User for MySQL
- Inside the container:
docker-compose exec db bash root@e42d3f4adfg:/# mysql -u root -p mysql> GRANT ALL ON laravel.* TO 'laraveluser'@'%' IDENTIFIED BY 'your_laravel_db_password'; mysql> FLUSH PRIVILEGES; mysql> EXIT;
See more https://github.com/francescomalatesta/laravel-api-boilerplate-jwt.
The Laravel framework is open-sourced software licensed under the MIT license.