test/custom-admin-ui #3
+26
-1
@@ -1,4 +1,25 @@
|
|||||||
FROM python:3.9.5-slim-buster
|
# 第一阶段:构建前端主题
|
||||||
|
FROM node:18-alpine AS frontend-builder
|
||||||
|
|
||||||
|
# 安装 git
|
||||||
|
RUN apk add --no-cache git
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
# 克隆并构建 2024 主题
|
||||||
|
RUN git clone --depth 1 https://github.com/vastsa/FileCodeBoxFronted.git fronted-2024 && \
|
||||||
|
cd fronted-2024 && \
|
||||||
|
npm install && \
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
# 克隆并构建 2023 主题
|
||||||
|
RUN git clone --depth 1 https://github.com/vastsa/FileCodeBoxFronted2023.git fronted-2023 && \
|
||||||
|
cd fronted-2023 && \
|
||||||
|
npm install && \
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
# 第二阶段:构建最终镜像
|
||||||
|
FROM python:3.12-slim-bookworm
|
||||||
LABEL author="Lan"
|
LABEL author="Lan"
|
||||||
LABEL email="xzu@live.com"
|
LABEL email="xzu@live.com"
|
||||||
|
|
||||||
@@ -14,6 +35,10 @@ WORKDIR /app
|
|||||||
# 删除不必要的目录,减少镜像体积
|
# 删除不必要的目录,减少镜像体积
|
||||||
RUN rm -rf docs fcb-fronted
|
RUN rm -rf docs fcb-fronted
|
||||||
|
|
||||||
|
# 从构建阶段复制编译好的前端主题
|
||||||
|
COPY --from=frontend-builder /build/fronted-2024/dist /app/themes/2024
|
||||||
|
COPY --from=frontend-builder /build/fronted-2023/dist /app/themes/2023
|
||||||
|
|
||||||
# 安装依赖
|
# 安装依赖
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -4,12 +4,12 @@
|
|||||||
# @Software: PyCharm
|
# @Software: PyCharm
|
||||||
from typing import Generic, TypeVar
|
from typing import Generic, TypeVar
|
||||||
|
|
||||||
from pydantic.v1.generics import GenericModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
T = TypeVar("T")
|
T = TypeVar("T")
|
||||||
|
|
||||||
|
|
||||||
class APIResponse(GenericModel, Generic[T]):
|
class APIResponse(BaseModel, Generic[T]):
|
||||||
code: int = 200
|
code: int = 200
|
||||||
message: str = "ok"
|
message: str = "ok"
|
||||||
detail: T
|
detail: T
|
||||||
|
|||||||
+7
-7
@@ -1,8 +1,8 @@
|
|||||||
aioboto3==13.4.0
|
aioboto3==15.5.0
|
||||||
aiohttp==3.13.3
|
aiohttp==3.13.3
|
||||||
aiofiles==24.1.0
|
aiofiles==25.1.0
|
||||||
fastapi==0.115.6
|
fastapi==0.128.0
|
||||||
pydantic==2.10.4
|
pydantic==2.12.5
|
||||||
uvicorn==0.34.0
|
uvicorn==0.40.0
|
||||||
tortoise-orm==0.22.1
|
tortoise-orm==0.25.3
|
||||||
python-multipart==0.0.20
|
python-multipart==0.0.21
|
||||||
|
|||||||
Reference in New Issue
Block a user