Build from source, fix API base URL to use Vite proxy

This commit is contained in:
_Yusaki 2026-03-13 01:04:15 +07:00
parent 761dbddbf9
commit 2279d2a321
2 changed files with 2 additions and 6 deletions

View file

@ -1,8 +1,6 @@
services:
mirofish:
image: ghcr.io/666ghj/mirofish:latest
# 加速镜像(如拉取缓慢可替换上方地址)
# image: ghcr.nju.edu.cn/666ghj/mirofish:latest
build: .
container_name: mirofish
environment:
- LLM_API_KEY=${LLM_API_KEY}
@ -12,8 +10,6 @@ services:
expose:
- "3000"
- "5001"
command: >
sh -c "sed -i 's/server: {/server: { allowedHosts: true,/' /app/frontend/vite.config.js && echo 'VITE_API_BASE_URL=' > /app/frontend/.env && npm run dev"
restart: unless-stopped
volumes:
- ./backend/uploads:/app/backend/uploads

View file

@ -2,7 +2,7 @@ import axios from 'axios'
// 创建axios实例
const service = axios.create({
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:5001',
baseURL: '/api',
timeout: 300000, // 5分钟超时本体生成可能需要较长时间
headers: {
'Content-Type': 'application/json'