LLM-fastAPI / Dockerfile
Songyou's picture
Update Dockerfile
74cf107 verified
raw
history blame
423 Bytes
# 使用官方 Python 3.8 基础镜像
FROM python:3.8-slim
# 设置工作目录
RUN useradd -m -u 1000 user
WORKDIR /app
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . /app
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# 启动 FastAPI 应用
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]