From a199129ada8296a912d5e3d2c7c3c20e3ca74a41 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 31 Oct 2025 09:28:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4f0f57c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +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:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file