我擅长API创建,但在设置系统方面却不太好,我试图学习使用docker设置laravel并引用: https://medium.com/@shakyShane/laravel-docker-part-1-setup-for-development-e3daaefaf3c
我正确地执行了所有步骤,但仍在运行:
docker-compose exec app php artisan key:generate
我遇到错误:
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
我错误地认为这个问题是因为作曲家没有运行!
我的项目文件夹位于桌面中
我的docker-compose.yml的写法如下:
# The Application
`app:`
`build:`
`context: ./`
`dockerfile: app.dockerfile`
`working_dir: /var/www`
`volumes:`
`- ./:/var/www``
` environment:`
`- "DB_PORT=3306"`
`- "DB_HOST=database"`
# The Web Server
`web:`
`build:`
`context: ./`
`dockerfile: web.dockerfile`
`working_dir: /var/www`
`volumes_from:`
`- app`
`ports:`
`- 8080:80`
我在网上检查了其他解决方案,但我不太明白该怎么做。