Changing location of tmp directory

Hello.
Is it possible to change location of “tmp” dir and how?
For example now my tmp dir is in /var/discourse/tmp
and i want temp files to be created in /tmp/discourse-tmp

What problem are you trying to solve?

One solution might be do create a docker volume for /tmp that points to wherever you want on the host file system.

2 Likes

the problem is because i mounted discourse from host to docker, so folder /var/discourse in shared directory between host (which is on windows) and client os (which is on linux). And because of that, there are some problems.
One of the problem i described today: Problem with development on Windows with Docker and mounted volume

when discourse try to generate some files in “tmp” directory it gets errors, because it expect filesystem to be case sensitive, but mounted directory uses windows ntfs filesystem, that is case insensitive.

If i can somehow change location of tmp dir, so it will be in /tmp, then problem will go away, because guest os filesystem is ext4 which support case sensitive directories

I’d just move all of Discourse to a non-stupid file system (Actually, I quit using Windows around Win98). Failing that, you can add a volume for just /tmp.