File size: 1,139 Bytes
7ea9cd8
b052258
c5cd6a3
b052258
 
 
 
 
 
 
 
 
 
 
 
 
c5cd6a3
b052258
 
 
462c128
 
 
f5a4e79
c5cd6a3
 
b052258
c5cd6a3
 
 
b052258
c5cd6a3
 
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
32
33
FROM python:3.10-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    python3-dev \
    gcc \
    g++ \
    cmake \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Upgrade pip
RUN pip install --upgrade pip setuptools wheel

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

# Install the Tagalog model wheel using a valid local filename.
# The upstream filename omits version and fails pip validation when installed by URL.
RUN python -c "import urllib.request, subprocess, sys; u='https://huggingface.co/ljvmiranda921/tl_calamancy_md/resolve/main/tl_calamancy_md-any-py3-none-any.whl'; p='/tmp/tl_calamancy_md-0.2.0-py3-none-any.whl'; urllib.request.urlretrieve(u, p); subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--no-deps', p])"

# Copy the rest of your app
COPY . .

# Don't try to download models during build - let app handle it at runtime
# Just create the models directory if needed
RUN mkdir -p /app/models

EXPOSE 7860
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers=1", "--threads=2", "app:app"]