At my Digital Ocean basic application, I used CRUD photo folder under public directory at laravel. But when I deploy the application from GitHub repo, it remove all photos and make same with my GitHub repo. Is there anyway to exclude the custom folders under public directory of laravel?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there @rockoo,
This happens as the DigitalOcean App platform is based on Kubernetes, meaning that each deployment is a separate immutable container.
So after each redeployment, all changes to the container will be lost.
To sort this out, you need to use an Object Storage, like the DigitalOcean Spaces.
To do so, you can follow the instructions from step 5 of this tutorial here:
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-scalable-laravel-6-application-using-managed-databases-and-object-storage
Basically, what you need to do is:
s3
driver:.env
file:config/filesystems.php
you need to define the details for your S3 bucket as follows:Still, in the same file, locate the cloud entry and change it to set the new spaces disk as the default cloud filesystem disk:
Once you implement the S3 driver or the DigitalOcean Space, you will have persistent storage, so when your users upload images via your app, the images will not be uploaded to the container inside the DigitalOcean App itself, but the S3 bucket, so once the container gets redeployed your images will stay intact on the object storage.
Hope that this helps. Let me know how it goes. Best, Bobby