ibrunotome / laravel-api-templates

Laravel API starter kit collection using different structures.
MIT License
266 stars 82 forks source link

Docker compose Failed opening required '/var/www/public/../vendor/autoload.php' #42

Closed devmansurov closed 2 years ago

devmansurov commented 2 years ago

Hi. When I run your project inside docker with command:

docker-compose -f docker-compose.develop.yml up -d

I get error with load vendor/autoload.php file from nginx service. How I can fix this error?

Error message:

"PHP message: PHP Warning: require(/var/www/public/../vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/public/index.php on line 28PHP message: PHP Fatal error: Uncaught Error: Failed opening required '/var/www/public/../vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/public/index.php:28

ibrunotome commented 2 years ago
docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v $(pwd):/var/www/html \
    -w /var/www/html \
    laravelsail/php80-composer:latest \
    composer install --ignore-platform-reqs

or

composer i if you have composer installed locally.