|
|
@@ -43,11 +43,15 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
|
# Copy app files
|
|
|
COPY . .
|
|
|
|
|
|
-# Create cache directories
|
|
|
-RUN mkdir -p /tmp/hf_cache /tmp/torch_cache /tmp/qwen3-uncensored-lora /tmp/merged_model
|
|
|
-
|
|
|
# Create non-root user for HF Spaces
|
|
|
RUN useradd -m -u 1000 user
|
|
|
+
|
|
|
+# Create cache directories and make them owned by the non-root user
|
|
|
+RUN mkdir -p /tmp/hf_cache /tmp/torch_cache /tmp/qwen3-uncensored-lora /tmp/merged_model \
|
|
|
+ && chown -R user:user /tmp/hf_cache /tmp/torch_cache /tmp/qwen3-uncensored-lora /tmp/merged_model \
|
|
|
+ && chmod -R 777 /tmp/hf_cache /tmp/torch_cache /tmp/qwen3-uncensored-lora /tmp/merged_model \
|
|
|
+ && chown -R user:user /app
|
|
|
+
|
|
|
USER user
|
|
|
|
|
|
ENV HOME=/home/user
|