File size: 820 Bytes
38cfd11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# ── Hugging Face Spaces compatible Dockerfile ─────────────────────────────────
FROM python:3.11-slim

# HF Spaces runs as user 1000 β€” set this to avoid permission errors
RUN useradd -m -u 1000 user
USER user

# Add user's local bin to PATH
ENV PATH="/home/user/.local/bin:$PATH"

WORKDIR /app

# Copy and install dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt

# Download NLTK data
RUN python -m nltk.downloader punkt punkt_tab

# Copy app files
COPY --chown=user main.py .
COPY --chown=user model_compressed.joblib .

# Hugging Face Spaces REQUIRES port 7860
EXPOSE 7860

# Run on port 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]