File size: 717 Bytes
3a35507
12b8fe9
 
 
 
 
 
 
3a35507
d2f7981
 
3a35507
 
 
12b8fe9
 
 
3a35507
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

FROM python:3.10-slim

# Install dependencies
RUN pip install --upgrade pip
COPY requirements.txt .
RUN pip install -r requirements.txt

# Create writable Hugging Face cache
RUN mkdir -p /tmp/hf-cache

# Preload the model to avoid runtime LFS issues
RUN python -c "import os; os.environ['HF_HOME'] = '/tmp/hf-cache'; from transformers import AutoTokenizer, AutoModelForSequenceClassification; AutoTokenizer.from_pretrained('cybersectony/phishing-email-detection-distilbert_v2.4.1'); AutoModelForSequenceClassification.from_pretrained('cybersectony/phishing-email-detection-distilbert_v2.4.1')"

# Copy app files
COPY main.py .

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