diff --git a/Dockerfile b/Dockerfile index f75d076..01857f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,9 +51,8 @@ COPY frontend/package*.json ./frontend/ # Copy the built .next folder and public assets COPY --from=frontend-builder /app/frontend/.next ./frontend/.next COPY --from=frontend-builder /app/frontend/public ./frontend/public -# Install ONLY production dependencies for frontend -WORKDIR /app/frontend -RUN npm ci --only=production +# 复制 node_modules 而不是重新安装(避免网络超时问题) +COPY --from=frontend-builder /app/frontend/node_modules ./frontend/node_modules/ # 5. Copy Backend & Application Code WORKDIR /app diff --git a/backend/app/database.py b/backend/app/database.py index 1526d71..7c3de7f 100644 --- a/backend/app/database.py +++ b/backend/app/database.py @@ -16,7 +16,11 @@ DATABASE_URL = f"postgresql+asyncpg://{os.getenv('DB_USER')}:{os.getenv('DB_PASS engine = create_async_engine( DATABASE_URL, echo=False, # 设置为 True 可以看到 SQL 日志 - future=True + future=True, + pool_size=20, # 核心连接池大小 + max_overflow=30, # 溢出连接池大小 + pool_timeout=30, # 获取连接的超时时间(秒) + pool_recycle=3600 # 连接回收时间(1小时),防止长时间闲置连接被数据库关闭 ) # 创建异步 Session 工厂 diff --git a/bastian/ca.crt b/bastian/ca.crt new file mode 100644 index 0000000..e69de29 diff --git a/docker-run.sh b/docker-run.sh index 3be5c43..846aab0 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -39,6 +39,9 @@ docker rm -f $CONTAINER_NAME 2>/dev/null || true echo "启动新容器..." docker run -d \ --name $CONTAINER_NAME \ + --dns 8.8.8.8 \ + --dns 8.8.4.4 \ + --dns 114.114.114.114 \ -e PW_SERVICE_ID="$PW_SERVICE_ID" \ -e PW_SERVER_ADDRS="$PW_SERVER_ADDRS" \ -e PW_LOCAL_PORT="$PW_LOCAL_PORT" \ diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 89d4c5b..d870f20 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -1,10 +1,7 @@ import type { Metadata } from "next"; -import { Inter } from "next/font/google"; // Using Inter for now as safe default or stick to Geist import "./globals.css"; import { NavHeader } from "@/components/nav-header"; -const inter = Inter({ subsets: ["latin"] }); - export const metadata: Metadata = { title: "Stock Analysis App", description: "AI Powered Stock Analysis", @@ -17,7 +14,7 @@ export default function RootLayout({ }>) { return ( - +
{children}
diff --git a/frontend/src/components/ai-discussion-view.tsx b/frontend/src/components/ai-discussion-view.tsx index 875c0b4..32bf512 100644 --- a/frontend/src/components/ai-discussion-view.tsx +++ b/frontend/src/components/ai-discussion-view.tsx @@ -478,6 +478,17 @@ function ChatPane({

{children}

, + strong: ({ node, children, ...props }) => {children}, + em: ({ node, children, ...props }) => {children}, + a: ({ node, href, children, ...props }) => {children}, + ul: ({ node, children, ...props }) => , + ol: ({ node, children, ...props }) =>
    {children}
, + li: ({ node, children, ...props }) =>
  • {children}
  • , + h1: ({ node, children, ...props }) =>

    {children}

    , + h2: ({ node, children, ...props }) =>

    {children}

    , + h3: ({ node, children, ...props }) =>

    {children}

    , + blockquote: ({ node, children, ...props }) =>
    {children}
    , pre: ({ node, className, ...props }) =>
    ,
                                                     code: ({ node, className, children, ...props }) => {
                                                         const match = /language-(\w+)/.exec(className || '')