name: "php run script"

mode: ONCE
hostname: "php"
log_level: ERROR

disable_rl: true

cwd: "/tmp"

clone_newnet: false
clone_newuser: {CLONE_NEWUSER}

keep_caps: false
keep_env: true
mount_proc: true

mount {
    src: "/bin"
    dst: "/bin"
	is_bind: true
}

mount {
    src: "/lib"
    dst: "/lib"
	is_bind: true
}


mount {
    src: "/lib64"
    dst: "/lib64"
	is_bind: true
    mandatory: false
}


mount {
    src: "/usr"
    dst: "/usr"
	is_bind: true
}

mount {
	src: "/dev/null"
	dst: "/dev/null"
	is_bind: true
	rw: true
}

mount {
	dst: "/tmp"
	fstype: "tmpfs"
	rw: true
    options: "size=800000000"
}

mount {
    src: "{JOB_DIR}/main.php"
    dst: "/tmp/main.php"
    is_bind: true
    mandatory: false
}

mount {
    src: "{JOB_DIR}/wrapper.php"
    dst: "/tmp/wrapper.php"
    is_bind: true
    mandatory: false
}

mount {
    src: "/etc"
    dst: "/etc"
	is_bind: true
}

mount {
    src: "/dev/random"
    dst: "/dev/random"
    is_bind: true
}

mount {
    src: "/dev/urandom"
    dst: "/dev/urandom"
    is_bind: true
}

mount {
    src: "{JOB_DIR}/args.json"
    dst: "/tmp/args.json"
    is_bind: true
}

mount {
    src: "{JOB_DIR}/result.json"
    dst: "/tmp/result.json"
    rw: true
    is_bind: true
}

mount {
    src: "{JOB_DIR}/composer.json"
    dst: "/tmp/composer.json"
    is_bind: true
    mandatory: false
}

mount {
    src: "{JOB_DIR}/composer.lock"
    dst: "/tmp/composer.lock"
    is_bind: true
    mandatory: false
}

mount {
    src: "{JOB_DIR}/vendor"
    dst: "/tmp/vendor"
    is_bind: true
    mandatory: false
}

iface_no_lo: true

mount {
    src: "{CACHE_DIR}"
    dst: "/tmp/windmill/cache/php"
    is_bind: true
    rw: true
    mandatory: false
}

{SHARED_MOUNT}

envar: "HOME=/tmp"
