Spaces:
Sleeping
Sleeping
fixed font path for HF Spaces
Browse files- Dockerfile +9 -7
Dockerfile
CHANGED
|
@@ -23,19 +23,21 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|
| 23 |
# Copy all app files
|
| 24 |
COPY . .
|
| 25 |
|
| 26 |
-
# Download Kalimati font
|
| 27 |
RUN mkdir -p /app/fonts && \
|
| 28 |
-
curl -
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
echo "WARNING: Kalimati font download failed, falling back to Noto Sans Devanagari"
|
| 33 |
|
| 34 |
# Register Kalimati font with system font cache
|
| 35 |
RUN if [ -f /app/fonts/Kalimati.ttf ]; then \
|
| 36 |
mkdir -p /usr/local/share/fonts/nepali && \
|
| 37 |
cp /app/fonts/Kalimati.ttf /usr/local/share/fonts/nepali/ && \
|
| 38 |
-
fc-cache -fv
|
|
|
|
|
|
|
|
|
|
| 39 |
fi
|
| 40 |
|
| 41 |
# Set environment variables
|
|
|
|
| 23 |
# Copy all app files
|
| 24 |
COPY . .
|
| 25 |
|
| 26 |
+
# Download Kalimati font — using reliable GitHub raw URL
|
| 27 |
RUN mkdir -p /app/fonts && \
|
| 28 |
+
curl -fL "https://github.com/mhnpd/nepali-font/raw/master/fonts/Kalimati.ttf" \
|
| 29 |
+
-o /app/fonts/Kalimati.ttf && \
|
| 30 |
+
echo "✅ Kalimati downloaded: $(wc -c < /app/fonts/Kalimati.ttf) bytes" || \
|
| 31 |
+
echo "⚠️ Kalimati download failed — NotoSansDevanagari will be used as fallback"
|
|
|
|
| 32 |
|
| 33 |
# Register Kalimati font with system font cache
|
| 34 |
RUN if [ -f /app/fonts/Kalimati.ttf ]; then \
|
| 35 |
mkdir -p /usr/local/share/fonts/nepali && \
|
| 36 |
cp /app/fonts/Kalimati.ttf /usr/local/share/fonts/nepali/ && \
|
| 37 |
+
fc-cache -fv && \
|
| 38 |
+
echo "✅ Kalimati font registered with system"; \
|
| 39 |
+
else \
|
| 40 |
+
echo "⚠️ Skipping font registration — file not found"; \
|
| 41 |
fi
|
| 42 |
|
| 43 |
# Set environment variables
|