fix: 修改dockerfile文件
This commit is contained in:
parent
1aed3a8490
commit
7b2b99daea
13
Dockerfile
13
Dockerfile
@ -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"]
|
|
||||||
|
Loading…
Reference in New Issue
Block a user