Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variables for paths used #337

Open
Entrivax opened this issue Dec 29, 2023 · 3 comments
Open

Environment variables for paths used #337

Entrivax opened this issue Dec 29, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@Entrivax
Copy link

I've seen the paths to the work directories like /tmp or /vods are hardcoded. I would love for them to be changed with environment variables. In my case, I have a huge performance hit when the download of a big VOD is done and need to be moved, because it's moving files between two volumes, it copies the file when moving instead of just a move operation.

I would like to put both the temp working directory and the vods directory in a same parent directory that I would then mount, instead of mounting the /tmp and /vods separately. (I mounted the /tmp because I'm using Docker with WSL, and it was increasing the WSL virtual drive by a huge amount.)

In my case, I would like to do something like this:

  • GANYMEDE_TEMP_DIR=/data/.tmp
  • GANYMEDE_VODS_DIR=/data/vods

and then mount the /data path.

@russelg
Copy link

russelg commented Jan 4, 2024

Seconding this, this is something I also need.

@Zibbp Zibbp added the enhancement New feature or request label Jan 4, 2024
@ccKep
Copy link

ccKep commented Jan 17, 2024

You should be able to already do this using the docker-compose.yml or am I wrong? Just change the mounts like this:

    volumes:
      - /data/vods:/vods
      - ./logs:/logs
      # notice this is ./data while the others are /data
      - ./data:/data
      - /data/.tmp:/tmp

@russelg
Copy link

russelg commented Jan 17, 2024

I can't find a particular official source on why things are this way, but root level mounts like /vods and /tmp are problematic due to how docker handles volumes. Ideally you would mount a single directory such as /data which would have both /data/vods and /data/tmp. This would allow instant moves as they won't be considered cross-filesystem.

From https://trash-guides.info/Downloaders/qBittorrent/Basic-Setup/

The default path setup suggested by some docker developers that encourages people to use mounts like /movies, /tv, /books or /downloads is very suboptimal and it makes them look like two or three file systems, even if they aren’t (Because of how Docker’s volumes work). It is the easiest way to get started. While easy to use, it has a major drawback. Mainly losing the ability to hardlink or instant move, resulting in a slower and more I/O intensive copy + delete is used.

And some other reading I could find on the matter:
https://www.reddit.com/r/docker/comments/nj8111/moving_files_between_volumes_in_docker_is_slow/gz5vbrj/
https://wiki.servarr.com/docker-guide#consistent-and-well-planned-paths

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants