Skip to content

Dionnie123/laravel-docker-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Develop Laravel Project inside Docker for Beginners

By: Mark Dionnie Bulingit

Setup Laravel environment on Windows

Credits to ther Author, very comprehensive topic about dockerizing laravel.

https://medium.com/@chewysalmon/laravel-docker-development-setup-an-updated-guide-72842dfe8bdf

Keynotes

Laravel uses Composer to install dependencies, we use composer-image from dockerhub to install composer inside our project container and delete it after -pretty convenient.

docker run --rm -v ${pwd}:/app composer install

Now we have Composer but only inside the container, we will start ou laravel commands with e.g

docker-compose exec app php artisan key:generate

Composer dependency & PHP version error

composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0". You are running 8.0.30.

Go to package.json

   "config": {
        "platform-check": false
    },
docker run --rm -v ${pwd}:/app composer dump-autoload

Frequently used commands

Note: Make sure you're using Powershell terminal and Docker Desktop is running.

docker-compose down ; docker run --rm -v ${pwd}:/app composer install ; docker run --rm -v ${pwd}:/app composer install ; docker-compose up
  • Stops and Delete containers
  • Install dependecies
  • Start and run containers

Check Files

  • docker-compose.yaml
  • web.dockerfile
  • app.dockerfile
  • vhost.conf

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published