fix: 修改dockerfile文件

This commit is contained in:
huan 2024-08-12 10:59:08 +08:00
parent 1aed3a8490
commit 7b2b99daea

View File

@ -1,20 +1,11 @@
# 使用官方Node.js镜像作为基础镜像 FROM node:18-bullseye-slim
FROM node:18-alpine
# 设置工作目录
WORKDIR /app WORKDIR /app
# 复制package.json和package-lock.json
COPY package*.json ./ COPY package*.json ./
# 安装依赖
RUN npm install RUN npm install
# 复制项目文件
COPY . . COPY . .
# 暴露服务端口 CMD ["npm", "start"]
EXPOSE 3000
# 启动服务
CMD ["node", "index.js"]