dutchcoders / transfer.sh

Easy and fast file sharing from the command-line.
https://github.com/dutchcoders/transfer.sh
MIT License
15.09k stars 1.54k forks source link

Docker volume for uploads #561

Closed luckman212 closed 11 months ago

luckman212 commented 1 year ago

Sorry if this is a noob question, but I just spun up a transfer.sh instance (Docker) 🎉

I used this command to specify a persistent volume for the uploads:

docker run -d \
--name transfersh \
--restart=unless-stopped \
-v transfersh:/tmp \
-e BASEDIR=/tmp \
dutchcoders/transfer.sh:latest --provider local

Is this incorrect? Didn't see any mention anywhere of volumes.

Also, is /tmp the right place to map the volume to? It generally should always match BASEDIR?

aspacca commented 11 months ago

@luckman212 https://github.com/dutchcoders/transfer.sh/blob/main/Dockerfile#L35 there is a /tmp folder in the docker image already, that's used for temporary storage by different providers and/or when direct streaming (both for upload and download) of the content of a file cannot be achieved (I plan to review the usage of the tmp folder and avoid it as soon as possible if not totally remove it)

said that, as BASEDIR is better to use a different folder name, just change the volume mount point and the environment variable in your command and that will be fine

luckman212 commented 11 months ago

Got it. Thank you. I changed my run command to

docker run -d \
--name transfersh \
--restart=unless-stopped \
-v transfersh:/files \
-e BASEDIR=/files \
dutchcoders/transfer.sh:latest --provider local