Warning: Require(/var/www/vendor/autoload.php):

- 1 answer

I am good with API creation but not so good when it comes to set up the system, I was trying to learn setting laravel with docker and was referring:

I followed all the steps correctly but on running:

docker-compose exec app php artisan key:generate

I am getting error:

Warning: require(/var/www/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/artisan on line 18

Fatal error: require(): Failed opening required '/var/www/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/artisan on line 18

Am I wrong to assume that this problem is because the composer hasn't run!!

My Project folder is in Desktop

my docker-compose.yml is written like:

  # The Application
      `context: ./`
      `dockerfile: app.dockerfile`
    `working_dir: /var/www`
      `- ./:/var/www``
   ` environment:`
      `- "DB_PORT=3306"`
      `- "DB_HOST=database"`

  # The Web Server
      `context: ./`
      `dockerfile: web.dockerfile`
    `working_dir: /var/www`
      `- app`
      `- 8080:80`

I checked other solutions on the web but I couldn't quite understand how I need to do.



I think it is not a good idea to follow the steps provided in the website since the

composer image is DEPRECATED

you must use the newest one from here