create home and tmp directories in compile dir

This commit is contained in:
Brian Gough
2020-05-13 10:18:27 +01:00
parent 7254a025ae
commit ab8fb8351c
2 changed files with 6 additions and 2 deletions

View File

@@ -53,9 +53,12 @@ module.exports = CompileManager = {
}
const compileDir = getCompileDir(request.project_id, request.user_id)
const lockFile = Path.join(compileDir, '.project-lock')
// create local home and tmp directories in the compile dir
const homeDir = Path.join(compileDir, '.project-home')
const tmpDir = Path.join(compileDir, '.project-tmp')
// use a .project-lock file in the compile directory to prevent
// simultaneous compiles
return fse.ensureDir(compileDir, function(error) {
async.each([compileDir, homeDir, tmpDir], fse.ensureDir, function (error) {
if (error != null) {
return callback(error)
}

View File

@@ -71,7 +71,8 @@ if (process.env.DOCKER_RUNNER) {
image:
process.env.TEXLIVE_IMAGE || 'quay.io/sharelatex/texlive-full:2017.1',
env: {
HOME: '/tmp'
HOME: process.env.TEXLIVE_HOME || '/tmp',
TMPDIR: process.env.TEXLIVE_TMPDIR || '/tmp'
},
socketPath: '/var/run/docker.sock',
user: process.env.TEXLIVE_IMAGE_USER || 'tex'