chore: 完善全栈 Docker 开发环境与容器基础设施
This commit is contained in:
13
frontend/Dockerfile.dev
Normal file
13
frontend/Dockerfile.dev
Normal file
@ -0,0 +1,13 @@
|
||||
# ============================================================
|
||||
# 前端开发 Dockerfile — Vite + React HMR 热更新
|
||||
# ============================================================
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 先装依赖(利用 Docker 缓存层)
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm install
|
||||
|
||||
# 代码通过 docker-compose volumes 挂载
|
||||
CMD ["npx", "vite", "--host", "0.0.0.0"]
|
||||
Reference in New Issue
Block a user