Merge f55bc70fde into 96096ea0ff
This commit is contained in:
commit
6884bf85f6
14
Dockerfile
14
Dockerfile
|
|
@ -1,12 +1,13 @@
|
|||
FROM python:3.11
|
||||
|
||||
# 安装 Node.js (满足 >=18)及必要工具
|
||||
RUN apt-get update \
|
||||
RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends nodejs npm \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 从 uv 官方镜像复制 uv
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.9.26 /uv /uvx /bin/
|
||||
# 通过 pip 安装 uv(替代直接拉取 ghcr.io 官方镜像,避免国内网络卡顿)
|
||||
RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ uv
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
|
@ -15,10 +16,11 @@ COPY package.json package-lock.json ./
|
|||
COPY frontend/package.json frontend/package-lock.json ./frontend/
|
||||
COPY backend/pyproject.toml backend/uv.lock ./backend/
|
||||
|
||||
# 安装依赖(Node + Python)
|
||||
RUN npm ci \
|
||||
# 安装依赖(Node + Python),配置国内加速源
|
||||
RUN npm config set registry https://registry.npmmirror.com \
|
||||
&& npm ci \
|
||||
&& npm ci --prefix frontend \
|
||||
&& cd backend && uv sync --frozen
|
||||
&& cd backend && env UV_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ uv sync --frozen
|
||||
|
||||
# 复制项目源码
|
||||
COPY . .
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import i18n from '../i18n'
|
|||
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:5001',
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || '',
|
||||
timeout: 300000, // 5分钟超时(本体生成可能需要较长时间)
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ export default defineConfig({
|
|||
},
|
||||
server: {
|
||||
port: 3000,
|
||||
open: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:5001',
|
||||
|
|
|
|||
Loading…
Reference in New Issue