Skip to content

narvikd/simplelaravelcompose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Laravel Compose

Instructions

git clone $repo # Clone
cd src # Move to source where the laravel install will reside
rm src/.keep # Remove the keep file or Compose will yell at you
composer create-project laravel/laravel . # Install a fresh copy of Laravel. (You can move your own.)
docker-compose build && docker-compose up -d # Build and start the containers. (You can use the start.sh file on the root directory.)

Laravel Root

Now edit simplelaravelcompose/src/.env and modify this:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

To make it point to the mysql container, db and pass. An example is included in the root directory (laravelenv.example.env):

DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=db
DB_USERNAME=root
DB_PASSWORD=rootpass

Note:

Don't use php commands locally, they're not going to work. Instead execute them directly through the php container. (PS: You don't need php artisan serve because you're already serving it.)

For example, we would execute migrations like this:

docker-compose exec php php /var/www/html/artisan migrate

Laravel migration

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published