Compare commits

..

No commits in common. "b40bc183d04892239825c127d7e8d1dc1916e0af" and "36b5a1db2d626188f6c139aac4ca851070adb0bd" have entirely different histories.

5 changed files with 6 additions and 10 deletions

View File

@ -1,5 +1,5 @@
# 使用Python官方镜像
FROM python:3.11-slim
FROM python:3.9-slim
# 设置工作目录
WORKDIR /app
@ -8,7 +8,7 @@ WORKDIR /app
COPY requirements.txt .
# 安装依赖
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install --no-cache-dir -r requirements.txt
# 复制项目文件
COPY . .

View File

@ -1,5 +1,3 @@
pydantic<2.0
asyncmy>=0.2.10
fastapi>=0.95.2
python-dotenv>=1.0.0
sqlalchemy>=2.0.15
@ -8,5 +6,4 @@ bcrypt>=4.0.1
pyjwt>=2.6.0
pytest>=7.3.1
requests>=2.28.2
cryptography>=42.0.2
uvicorn[standard]>=0.21.1

View File

@ -1,6 +1,6 @@
from datetime import datetime
from enum import Enum
from pydantic import BaseModel, Field, root_validator
from pydantic import BaseModel, Field, model_validator
from typing import Optional
# 用户角色枚举
@ -27,7 +27,7 @@ class UserUpdate(BaseModel):
description: Optional[str] = Field(None, max_length=255, description="用户描述")
# 可选:确保至少更新一个字段
@root_validator
@model_validator(mode='before')
def validate_at_least_one_field(cls, values):
if not any(values.values()):
raise ValueError("至少需要更新一个字段")

View File

@ -8,8 +8,7 @@ WORKDIR /app
COPY package*.json ./
# 安装依赖
RUN npm config set registry https://registry.npmmirror.com && \
npm install
RUN npm install
# 复制项目文件
COPY . .

View File

@ -9,7 +9,7 @@ http {
listen 80;
location /api/ {
proxy_pass http://backend:8000;
proxy_pass http://backend:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;