add requirements

This commit is contained in:
朱潮 2025-10-29 22:37:29 +08:00
parent 3583a50695
commit d3ed76d0c1
5 changed files with 29 additions and 18 deletions

View File

@ -14,21 +14,15 @@ RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debia
apt-get install -y gcc sqlite3 && \
rm -rf /var/lib/apt/lists/*
# 安装Poetry
# 复制requirements文件并安装Python依赖
COPY requirements.txt .
# 配置pip使用阿里云镜像源
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
pip config set global.trusted-host mirrors.aliyun.com && \
pip install --no-cache-dir poetry
pip install --no-cache-dir -r requirements.txt
# 复制项目文件
COPY pyproject.toml poetry.lock* ./
# 配置Poetry使用阿里云镜像源并安装依赖
RUN poetry config pypi-token.pypi-token "" && \
poetry config repositories.aliyun https://mirrors.aliyun.com/pypi/simple/ && \
poetry source add --priority=secondary aliyun https://mirrors.aliyun.com/pypi/simple/ && \
poetry install --no-dev --no-interaction --no-ansi
# 复制剩余的项目文件
COPY . .
# 暴露端口
@ -39,4 +33,4 @@ ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
# 启动命令
CMD ["poetry", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

6
poetry.lock generated
View File

@ -221,14 +221,14 @@ files = [
[[package]]
name = "fastapi"
version = "0.120.1"
version = "0.120.2"
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"
optional = false
python-versions = ">=3.8"
groups = ["main"]
files = [
{file = "fastapi-0.120.1-py3-none-any.whl", hash = "sha256:0e8a2c328e96c117272d8c794d3a97d205f753cc2e69dd7ee387b7488a75601f"},
{file = "fastapi-0.120.1.tar.gz", hash = "sha256:b5c6217e9ddca6dfcf54c97986180d4a1955e10c693d74943fc5327700178bff"},
{file = "fastapi-0.120.2-py3-none-any.whl", hash = "sha256:bedcf2c14240e43d56cb9a339b32bcf15104fe6b5897c0222603cb7ec416c8eb"},
{file = "fastapi-0.120.2.tar.gz", hash = "sha256:4c5ab43e2a90335bbd8326d1b659eac0f3dbcc015e2af573c4f5de406232c4ac"},
]
[package.dependencies]

View File

@ -578,7 +578,7 @@
<td class="grade-cell">${report.grade}</td>
<td class="school-cell">${report.school}</td>
<td class="action-cell">
<a href="/public/report.html?id=${report.id}" class="view-btn">查看报告</a>
<a href="/report.html?id=${report.id}" class="view-btn">查看报告</a>
</td>
`;

View File

@ -96,7 +96,7 @@ class ReportListManager {
<td class="grade-cell">${report.grade}</td>
<td class="school-cell">${report.school}</td>
<td class="action-cell">
<a href="/public/report.html?id=${report.id}" class="view-btn">查看报告</a>
<a href="/report.html?id=${report.id}" class="view-btn">查看报告</a>
</td>
`;

View File

@ -1,7 +1,24 @@
annotated-doc==0.0.3
annotated-types==0.7.0
anyio==4.11.0
certifi==2025.10.5
charset-normalizer==3.4.4
click==8.3.0
et_xmlfile==2.0.0
fastapi==0.120.2
h11==0.16.0
huey==2.5.1
idna==3.11
Jinja2==3.1.6
MarkupSafe==3.0.3
openpyxl==3.1.5
pydantic==2.12.3
pydantic_core==2.41.4
python-multipart==0.0.20
requests==2.32.5
sniffio==1.3.1
starlette==0.49.1
typing-inspection==0.4.2
typing_extensions==4.15.0
urllib3==2.5.0
uvicorn==0.38.0