fix: dockerfile修改
This commit is contained in:
parent
5fb1c87bc0
commit
0deaced829
17
Dockerfile
17
Dockerfile
@ -1,11 +1,20 @@
|
||||
FROM node:18-alpine
|
||||
# 使用官方的 Node.js 镜像作为基础镜像
|
||||
FROM node:18
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
||||
&& apk add --no-cache python3 make g++ \
|
||||
&& npm install
|
||||
# 复制 package.json 和 package-lock.json(如果有)到工作目录
|
||||
COPY package*.json ./
|
||||
|
||||
# 安装依赖
|
||||
RUN npm install
|
||||
|
||||
# 复制项目的源代码到工作目录
|
||||
COPY . .
|
||||
|
||||
# 暴露服务端口
|
||||
EXPOSE 3000
|
||||
|
||||
# 启动应用程序
|
||||
CMD ["npm", "start"]
|
||||
|
2170
package-lock.json
generated
2170
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user