I'm setting up Docker for a Laravel app which is an internal CDN with vast amount of images and other static files living in ./storage/app
, both private
and public
. I want the Docker image to be built with GitLab CI and my question is what is the right way of building it without overriding the contents of the storage? Those contents aren't present in the repo.
I have two thoughts about that:
Create a symlink from
/var/www/html
to project's./storage/app/public
and a symlink from/some_other_folder
to project's./storage/app/private
. In this case the question is can I write a file to a soft link of a folder and if I can, will the file really appear in the original folder of the symlink? If all of this is applicable, I am also interested if I can really create a symlink to a folder inside a Docker container...Set up Laravel Storage to write files externally instead of the folders inside the folder. In this case, the question is how should I configure Laravel and Docker to allow files to be written outside the container, putting them right into
/var/www/html
for public and/some_other_folder
for private?
Is either of the thoughts correct/good/even achievable? Or is there any other way of solving the problem?