17 lines
399 B
Docker
17 lines
399 B
Docker
FROM python:3.11-slim
|
|
|
|
# 设置 pip 全局使用国内源
|
|
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple/
|
|
ENV PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
|
pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] |