fix:优化项目内容
This commit is contained in:
@@ -21,22 +21,23 @@ services:
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
context: ./frontend_spa
|
||||
dockerfile: Dockerfile.dev
|
||||
image: aitool-frontend-dev
|
||||
working_dir: /app
|
||||
container_name: ops-core-frontend
|
||||
volumes:
|
||||
- ./frontend:/app
|
||||
# 保留容器内 node_modules,避免被宿主机目录覆盖
|
||||
- frontend_node_modules:/app/node_modules
|
||||
- ./frontend_spa:/app
|
||||
- frontend_spa_node_modules:/app/node_modules
|
||||
# 宿主机 3001 避免与占用 3000 的进程冲突;访问 http://localhost:3001
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
NODE_ENV: development
|
||||
NEXT_TELEMETRY_DISABLED: 1
|
||||
# 开发模式:先装依赖(volume 首次为空),再 dev,代码变更热更新
|
||||
command: sh -c "npm install && npm run dev"
|
||||
VITE_DEV_PROXY_TARGET: http://backend:8000
|
||||
# 开发模式:命令在 Dockerfile.dev 的 CMD 中
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
volumes:
|
||||
frontend_node_modules:
|
||||
frontend_spa_node_modules:
|
||||
|
||||
Reference in New Issue
Block a user