skip to Main Content

I using Laravel Sail. When I add composer packages I do it in the project folder with composer require .../... . But right now I’m wondering if it’s better to do it directly in the docker container. So ./vendor/bin/sail composer require .../...?

Note: Because I always have the latest PHP and node version installed on my system and therefore haven’t had any problems so far. But if I work on a computer without PHP then I have to load the dependencies within the container.

2

Answers


  1. I use the command sail bash and then I can run all artisan and composer commands from the cli inside the container.

    Login or Signup to reply.
  2. After you download your Laravel application, run the following command to have sail available within your project as seen in the official Laravel’s documentation:

    docker run --rm 
        -u "$(id -u):$(id -g)" 
        -v "$(pwd):/var/www/html" 
        -w /var/www/html 
        laravelsail/php84-composer:latest 
        composer install --ignore-platform-reqs
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search