|
@@ -1,14 +1,15 @@
|
|
|
# 使用 node 18 作为基础镜像
|
|
|
-FROM node:18
|
|
|
+FROM node:18.20.4
|
|
|
|
|
|
# 设置工作目录
|
|
|
WORKDIR /app
|
|
|
|
|
|
# 安装 yarn@1
|
|
|
-RUN npm install -g yarn@1
|
|
|
+# RUN npm install -g yarn@1 --registry=https://registry.npmmirror.com
|
|
|
|
|
|
# 将 package.json 和 yarn.lock 拷贝到容器中
|
|
|
-COPY package.json yarn.lock ./
|
|
|
+# COPY package.json yarn.lock ./
|
|
|
+COPY package*.json ./
|
|
|
|
|
|
# 安装依赖,并设置国内镜像
|
|
|
RUN npm install --registry=https://registry.npmmirror.com
|
|
@@ -23,4 +24,4 @@ EXPOSE 3000
|
|
|
VOLUME /app/base_files
|
|
|
|
|
|
# 启动应用(根据您项目的启动命令修改)
|
|
|
-CMD ["yarn", "start"]
|
|
|
+CMD ["node", "app.js"]
|