采购件图像上传初实现

This commit is contained in:
dxc
2026-02-03 11:16:12 +08:00
parent efcd2d923c
commit 7fa40115d9
7 changed files with 510 additions and 91 deletions

View File

@ -19,14 +19,15 @@ services:
# --- 后端 Flask 服务 ---
backend:
build:
context: ./inventory-backend # 【修改】指向你的新后端目录
context: ./inventory-backend # 指向你的新后端目录
container_name: inventory_api
restart: always
ports:
- "8000:8000"
volumes:
- ./inventory-backend:/app # 挂载代码,实现热更新
# 加上 --reload 参数,代码变了自动重启
# 【核心修改】显式挂载 uploads 目录,确保图片持久化且宿主机可见
- ./inventory-backend/uploads:/app/uploads
command: gunicorn -c gunicorn.conf.py run:app --reload
environment:
# Host 必须写 'db'
@ -34,18 +35,17 @@ services:
depends_on:
- db
# --- 前端 Vue+Nginx 服务 ---
# --- 前端 Vue 开发服务 ---
# --- 前端 Vue 开发服务 ---
frontend:
build:
context: ./inventory-web
container_name: inventory_ui
restart: always
# 【重点1】把本地代码挂载进去,实现“热更新”
# 把本地代码挂载进去,实现“热更新”
volumes:
- ./inventory-web:/app
- /app/node_modules # 排除 node_modules防止冲突
# 【重点2】开发模式端口通常是 5173
# 开发模式端口通常是 5173
ports:
- "5173:5173"
depends_on: