PeAI / Dockerfile
MrA7A's picture
Update Dockerfile
cd1e5a4 verified
raw
history blame
993 Bytes
FROM python:3.9-slim-bullseye
# Fix locale (optional but recommended for some builds)
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
# Python settings
ENV PYTHONUNBUFFERED=1 \
HF_HOME="/tmp/hf_cache" \
TRANSFORMERS_CACHE="/tmp/hf_cache/transformers" \
HF_DATASETS_CACHE="/tmp/hf_cache/datasets" \
SENTENCE_TRANSFORMERS_HOME="/tmp/hf_cache/sentence_transformers"
WORKDIR /app
# Install full build deps for llama-cpp-python
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
libopenblas-dev \
libblas-dev \
liblapack-dev \
git \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements
COPY requirements.txt .
# Force pip to build from source, but with clean env
RUN pip install --upgrade pip setuptools wheel \
&& pip install --no-binary=:all: --no-cache-dir -r requirements.txt
# Copy app
COPY . .
# Expose port
EXPOSE 7860
# Command
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]