Spaces:
Runtime error
Runtime error
Fix HuggingFace cache permission denied error
Browse files- Create /.cache directory with proper permissions
- Set HF_HOME environment variable to writable cache path
- Resolves runtime permission error during model download
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Dockerfile +4 -2
Dockerfile
CHANGED
|
@@ -46,13 +46,15 @@ COPY data ./data
|
|
| 46 |
# Copy the built frontend from the builder stage
|
| 47 |
COPY --from=builder /app/ui/claimcheck-ui/dist ./static
|
| 48 |
|
| 49 |
-
# Create necessary directories
|
| 50 |
-
RUN mkdir -p kb/index data/audio
|
|
|
|
| 51 |
|
| 52 |
# Set environment variables for production
|
| 53 |
ENV PYTHONUNBUFFERED=1
|
| 54 |
ENV HOST=0.0.0.0
|
| 55 |
ENV PORT=7860
|
|
|
|
| 56 |
|
| 57 |
# Expose the port for Hugging Face Spaces
|
| 58 |
EXPOSE 7860
|
|
|
|
| 46 |
# Copy the built frontend from the builder stage
|
| 47 |
COPY --from=builder /app/ui/claimcheck-ui/dist ./static
|
| 48 |
|
| 49 |
+
# Create necessary directories and fix cache permissions
|
| 50 |
+
RUN mkdir -p kb/index data/audio /.cache && \
|
| 51 |
+
chmod 777 /.cache
|
| 52 |
|
| 53 |
# Set environment variables for production
|
| 54 |
ENV PYTHONUNBUFFERED=1
|
| 55 |
ENV HOST=0.0.0.0
|
| 56 |
ENV PORT=7860
|
| 57 |
+
ENV HF_HOME=/.cache
|
| 58 |
|
| 59 |
# Expose the port for Hugging Face Spaces
|
| 60 |
EXPOSE 7860
|