llama2-email-api / Dockerfile
Adekiitan11's picture
updated
78c3e31 verified
raw
history blame contribute delete
891 Bytes
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"]