my-llm-api / Dockerfile
han145's picture
Create Dockerfile
eb476b0 verified
Raw
History Blame Contribute Delete
523 Bytes
FROM python:3.9-slim
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
# 安装编译工具(部分 llama-cpp 环境依赖)与 Python 库
RUN apt-get update && apt-get install -y build-essential && \
pip install --no-cache-dir --upgrade -r /code/requirements.txt && \
apt-get purge -y --auto-remove build-essential && rm -rf /var/lib/apt/lists/*
COPY . .
# 启用高带宽下载支持
ENV HF_HUB_ENABLE_HF_TRANSFER=1
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]