init
This commit is contained in:
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
# 选择官方 Node 镜像
|
||||
FROM node:20-alpine
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
# 复制 package.json 和 package-lock.json
|
||||
COPY package*.json ./
|
||||
|
||||
# 安装依赖
|
||||
RUN npm install --production
|
||||
|
||||
# 复制应用代码
|
||||
COPY . .
|
||||
|
||||
# 暴露端口(根据你应用实际端口)
|
||||
EXPOSE 9080
|
||||
# 启动应用
|
||||
CMD ["npm", "start"]
|
||||
Reference in New Issue
Block a user