Build from source, fix API base URL to use Vite proxy
This commit is contained in:
parent
761dbddbf9
commit
2279d2a321
2 changed files with 2 additions and 6 deletions
|
|
@ -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
|
||||
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Reference in a new issue