File size: 908 Bytes
61a4cfd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Use an official Python runtime as a parent image
FROM python:3.11-slim

# Set the working directory
WORKDIR /app

# Install system dependencies (optional but recommended for some NLP libraries)
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Fix the KeyError by ensuring a compatible version is used 
# (This is already in requirements.txt, but we ensure it's prioritized)
RUN pip install "indic-transliteration<2.3.45"

# Setup the Sanskrit database (Required for process-sanskrit to work)
RUN update-ps-database

# Verify the import works now
RUN python -c "import process_sanskrit; print('Sanskrit library loaded successfully!')"

# Copy the rest of the application
COPY . .

EXPOSE 7860

ENV FLASK_APP=app.py

CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]