PHP工匠存储:链接删除存储的文件(Digitalocean)
情况:我在Digitalocean上上传了一个Laravel项目,并在YAML文件中的下一个命令中上传了
run_command: |-
php artisan migrate --force
php artisan storage:link
heroku-php-apache2 public/
问题:每个部署,这些命令正在运行并删除存储文件。如何在不删除上传文件的情况下部署?
其他信息: - 1-表记录不仅删除上传的文件 2-图像路径:base_url/storage/images/products/imagename.png
The case: I Upload a Laravel project on DigitalOcean with the next commands In Yaml file
run_command: |-
php artisan migrate --force
php artisan storage:link
heroku-php-apache2 public/
The issue: Every deployment, these commands are being run and the storage files are deleted. How can I deploy without deleting uploaded files?
additional info:-
1- Table records are not deleted Just the uploaded files
2- imagePath: base_url/storage/images/products/imageName.png
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决方案:这不是问题。问题是每个部署,Digitalocean每次都在不同的服务器(容器)上部署,因此它就像一个新设备。但是桌子没有清理,只是存储的东西
The Solution: It's not an issue. the problem is every deployment, DigitalOcean deploys every time on a different server (Container) so It's like a new device. but tables are not cleared just storage stuff
我使用此命令来解决此问题,
请确保您的存储文件夹不是.gitignore
到.gitignore删除公共/存储
I fix this problem with this command
make sure your storage folder is not .gitignore
got to .gitignore remove public/storage