t2
This commit is contained in:
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@ -0,0 +1,20 @@
|
||||
# 使用官方Node.js运行时作为基础镜像
|
||||
FROM node:18-alpine
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制package.json文件
|
||||
COPY package*.json ./
|
||||
|
||||
# 安装应用依赖
|
||||
RUN npm install --only=production
|
||||
|
||||
# 复制应用源代码
|
||||
COPY . .
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 3000
|
||||
|
||||
# 定义容器启动时运行的命令
|
||||
CMD ["npm", "start"]
|
||||
Reference in New Issue
Block a user