Closed EmberHeartshine closed 6 months ago
Hey @EmberHeartshine, for this pattern, I would actually just mount the /app/storage/app/uploads
folder, that way you don't interfere with any of the framework native directories, while still being able to mount your shots to a directory. For ex. -v /shotshare/uploads:/app/storage/app/uploads
.
In this instance I specifically made a bind mount because I wanted the files to be on the host filesystem instead of obfuscated away in Docker's volume tree.
In this instance I specifically made a bind mount because I wanted the files to be on the host filesystem instead of obfuscated away in Docker's volume tree.
So you should be able to use -v to accomplish this, if you specify a path before the colon it will use a path from your host file system, if you just use a string it will be a named volume.
-v /shotshare/uploads:/app/storage/app/uploads
should mount /shotshare/uploads on your host to /app/storage/app/uploads in your container.
Regardless of the syntax, I feel like the directories should be created if they're missing for whatever reason to avoid 500 errors.
Updated the docs to point to the correct directory (app/storage/app/uploads), I plan to revisit setup process for further simplifications. Additionally, this change will not be backwards compatible (it will only work for new installations where their shotshare_data volume is empty), to fix this you will need to
https://github.com/mdshack/shotshare?tab=readme-ov-file#run-in-https-mode
As noted, however, if you have the entire /app/storage directory mounted external to the docker image you don't have to change anything.
On a whim, and to see if I could keep things on my host machine, instead of creating a Docker volume with
-v shotshare_data:/app/storage
I created a directory under my host machine's ShotShare stuff,chown
'd to82:82
and mounted it with--mount type=bind,source=/shotshare/data,target=/app/storage
. This threw a 500 error (from caddy, not from nginx) so I went digging. It looks like the logger will create/app/storage/logs/
if needed, but if the empty directories already present in the Docker image aren't there as expected then ShotShare won't create them. Namely:/app/storage/app/
/app/storage/app/public/
/app/storage/framework/
/app/storage/framework/cache/
/app/storage/framework/cache/data/
/app/storage/framework/testing/
/app/storage/framework/views/
Interestingly, an exception to this is
/app/storage/app/uploads/
, which gets created on first upload just fine.