Skip to content

ashraf789/Laravel_docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run laravel project by docker

Environment setup

  • install and run docker to your local computer https://www.docker.com/get-started
  • copy all files from laravel-docker folder to inside your laravle project.
  • rename .env.docker to .env

Docker instructions

  1. For the first time, build the project [from second time build is not required]
    docker-compose build

  2. Run the project
    docker-compose up

    Now our project is running you can access app from web browser by http://localhost/
    If you run the project for the first time you also have to follow the below instructions

  3. install required composer packages
    docker exec -it app composer install

  4. install node packages
    docker exec -it app npm install

  5. migrate databases
    docker exec -it app php artisan migrate

  6. seed generate (optional)
    docker exec -it app php artisan db:seed

Additional information

  • To open a container shell
    docker exec -it container_name sh
    Example: if you want to access mysql(container) shell
    docker exec -it mysql sh

  • database access
    first access the mysql shell then run the below command
    mysql -uroot -pboos

Releases

No releases published

Packages

No packages published