diff --git a/Dockerfile b/Dockerfile index 94cd019..c513ce3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,9 @@ WORKDIR /app COPY package*.json ./ # 安装依赖 -RUN npm ci +RUN npm config set registry https://registry.npmmirror.com +RUN npm cache clean --force +RUN npm install # 复制所有源代码 COPY . . @@ -27,7 +29,9 @@ COPY --from=builder /app/server /app/server COPY --from=builder /app/package*.json /app/ # 只安装生产环境依赖 -RUN npm ci --only=production +RUN npm config set registry https://registry.npmmirror.com +RUN npm cache clean --force +RUN npm install --only=production # 设置环境变量 ENV PORT=3010 diff --git a/start.sh b/start.sh index fb3d42b..e08bb61 100644 --- a/start.sh +++ b/start.sh @@ -10,7 +10,7 @@ if [ ! -d "node_modules" ]; then fi # 启动后端服务器 -echo "启动后端服务器 (端口 3001)..." +echo "启动后端服务器 (端口 3010)..." node server/index.js & BACKEND_PID=$! @@ -24,7 +24,7 @@ FRONTEND_PID=$! echo "系统启动完成!" echo "前端地址: http://localhost:5173" -echo "后端API: http://localhost:3001" +echo "后端API: http://localhost:3010" echo "按 Ctrl+C 停止所有服务" # 捕获退出信号,清理进程