Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +6 -12
Dockerfile
CHANGED
|
@@ -1,19 +1,13 @@
|
|
| 1 |
-
# ============================================================================
|
| 2 |
-
# COMPLETE FIXED DOCKERFILE
|
| 3 |
-
# - Correct font packages
|
| 4 |
-
# - CPU/GPU auto-detection
|
| 5 |
-
# - Fixed permission issues
|
| 6 |
-
# - Proper cache directories
|
| 7 |
-
# ============================================================================
|
| 8 |
-
|
| 9 |
FROM python:3.10-slim
|
| 10 |
|
| 11 |
-
# Set environment variables for cache directories
|
| 12 |
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
|
| 13 |
ENV HF_HOME=/app/.cache/huggingface
|
| 14 |
ENV MPLCONFIGDIR=/app/.cache/matplotlib
|
| 15 |
ENV FONTCONFIG_PATH=/etc/fonts
|
| 16 |
-
ENV
|
|
|
|
|
|
|
| 17 |
ENV PYTHONUNBUFFERED=1
|
| 18 |
|
| 19 |
# Install system dependencies with correct font packages
|
|
@@ -40,7 +34,7 @@ RUN fc-list | grep -i devanagari || echo "Devanagari fonts installed manually"
|
|
| 40 |
WORKDIR /app
|
| 41 |
|
| 42 |
# Create cache directories with proper permissions
|
| 43 |
-
RUN mkdir -p /app/.cache/huggingface /app/.cache/matplotlib && \
|
| 44 |
chmod -R 777 /app/.cache
|
| 45 |
|
| 46 |
# Copy requirements and install Python packages
|
|
@@ -54,4 +48,4 @@ COPY app.py .
|
|
| 54 |
EXPOSE 7860
|
| 55 |
|
| 56 |
# Run the app
|
| 57 |
-
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Set environment variables for cache directories and fixes
|
| 4 |
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
|
| 5 |
ENV HF_HOME=/app/.cache/huggingface
|
| 6 |
ENV MPLCONFIGDIR=/app/.cache/matplotlib
|
| 7 |
ENV FONTCONFIG_PATH=/etc/fonts
|
| 8 |
+
ENV FONTCONFIG_FILE=/etc/fonts/fonts.conf
|
| 9 |
+
ENV FC_CACHEDIR=/app/.cache/fontconfig
|
| 10 |
+
ENV OMP_NUM_THREADS=1
|
| 11 |
ENV PYTHONUNBUFFERED=1
|
| 12 |
|
| 13 |
# Install system dependencies with correct font packages
|
|
|
|
| 34 |
WORKDIR /app
|
| 35 |
|
| 36 |
# Create cache directories with proper permissions
|
| 37 |
+
RUN mkdir -p /app/.cache/huggingface /app/.cache/matplotlib /app/.cache/fontconfig && \
|
| 38 |
chmod -R 777 /app/.cache
|
| 39 |
|
| 40 |
# Copy requirements and install Python packages
|
|
|
|
| 48 |
EXPOSE 7860
|
| 49 |
|
| 50 |
# Run the app
|
| 51 |
+
CMD ["python", "app.py"]
|