Spaces:
Sleeping
Sleeping
Remove fonts folder, download Kalimati in Dockerfile
Browse files- Dockerfile +10 -4
Dockerfile
CHANGED
|
@@ -4,7 +4,6 @@ FROM python:3.11-slim
|
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Install system dependencies
|
| 7 |
-
# fontconfig is needed to register and cache the Kalimati font
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
curl \
|
|
@@ -19,11 +18,18 @@ COPY requirements.txt .
|
|
| 19 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 20 |
pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
-
# Copy all app files
|
| 23 |
COPY . .
|
| 24 |
|
| 25 |
-
#
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
RUN if [ -f /app/fonts/Kalimati.ttf ]; then \
|
| 28 |
mkdir -p /usr/local/share/fonts/nepali && \
|
| 29 |
cp /app/fonts/Kalimati.ttf /usr/local/share/fonts/nepali/ && \
|
|
|
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Install system dependencies
|
|
|
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
build-essential \
|
| 9 |
curl \
|
|
|
|
| 18 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 19 |
pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
+
# Copy all app files
|
| 22 |
COPY . .
|
| 23 |
|
| 24 |
+
# Download Kalimati font directly (avoids committing binary to git)
|
| 25 |
+
RUN mkdir -p /app/fonts && \
|
| 26 |
+
curl -L "https://github.com/googlefonts/nepali-fonts/raw/main/fonts/Kalimati/Kalimati-Regular.ttf" \
|
| 27 |
+
-o /app/fonts/Kalimati.ttf || \
|
| 28 |
+
curl -L "https://github.com/virtual-labs/virtual-labs.github.io/raw/master/fonts/Kalimati.ttf" \
|
| 29 |
+
-o /app/fonts/Kalimati.ttf || \
|
| 30 |
+
echo "WARNING: Kalimati font download failed, Devanagari may not render correctly"
|
| 31 |
+
|
| 32 |
+
# Register font with system font cache
|
| 33 |
RUN if [ -f /app/fonts/Kalimati.ttf ]; then \
|
| 34 |
mkdir -p /usr/local/share/fonts/nepali && \
|
| 35 |
cp /app/fonts/Kalimati.ttf /usr/local/share/fonts/nepali/ && \
|