- 添加Dockerfile.dev用于开发环境 - 重构主Dockerfile使用多阶段构建 - 添加nginx配置和entrypoint脚本 - 更新docker-compose.yml配置 - 修改API基础路径为相对路径 - 更新vite配置支持环境变量
33 lines
854 B
TypeScript
33 lines
854 B
TypeScript
import { defineConfig, loadEnv } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import path from 'path'
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), '')
|
|
|
|
return {
|
|
plugins: [vue()],
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 5173,
|
|
proxy: {
|
|
'/api/chat': {
|
|
target: env.VITE_API_BASE_URL || 'https://thinkflow.lz-t.top',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api\/chat/, '/chat/completions')
|
|
},
|
|
'/api/image': {
|
|
target: env.VITE_API_BASE_URL || 'https://thinkflow.lz-t.top',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api\/image/, '/images/generations')
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
}
|
|
})
|