docker
This commit is contained in:
20
Dockerfile.dev
Normal file
20
Dockerfile.dev
Normal file
@@ -0,0 +1,20 @@
|
||||
# 使用官方 Node.js 运行时作为基础镜像
|
||||
FROM node:16-alpine
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制 package.json 和 package-lock.json(如果存在)
|
||||
COPY package*.json ./
|
||||
|
||||
# 安装所有依赖
|
||||
RUN npm ci
|
||||
|
||||
# 复制应用源代码
|
||||
COPY . .
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 3000
|
||||
|
||||
# 启动开发服务器
|
||||
CMD ["npm", "start"]
|
||||
Reference in New Issue
Block a user