File size: 891 Bytes
e5c558c
 
21ef2d5
e5c558c
 
 
21ef2d5
 
 
 
 
 
 
 
 
e5c558c
21ef2d5
e5c558c
 
 
78c3e31
 
21ef2d5
e5c558c
21ef2d5
 
1dee604
e5c558c
21ef2d5
ca7921d
 
 
 
21ef2d5
e5c558c
 
21ef2d5
e5c558c
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
34
35
36
37
38
39
FROM python:3.10-slim

# Avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    libglib2.0-0 \
    libsm6 \
    libxext6 \
    libxrender-dev \
    libomp-dev \
    && apt-get clean

# Copy app code and requirements
COPY ./app ./app
COPY requirements.txt .

RUN pip uninstall -y pinecone-plugin-inference || true

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

# Download spaCy English model
RUN python -m spacy download en_core_web_sm

# ✅ Set HuggingFace cache env to avoid permission errors
ENV TRANSFORMERS_CACHE=/tmp/huggingface
ENV HF_HOME=/tmp/huggingface
ENV HF_DATASETS_CACHE=/tmp/huggingface/datasets

# Expose port
EXPOSE 7860

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