alexcdev1 5 months ago
parent
commit
fa43199798
1 changed files with 2 additions and 3 deletions
  1. 2 3
      Dockerfile.prod

+ 2 - 3
Dockerfile.prod

@@ -47,7 +47,7 @@ RUN adduser --system --uid 1001 nextjs
 # 复制必要文件
 COPY --from=builder /app/public ./public
 COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
-COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
+COPY --from=builder /app/node_modules ./node_modules
 COPY --from=builder /app/package.json ./package.json
 
 # 设置为非 root 用户
@@ -59,5 +59,4 @@ EXPOSE 3000
 ENV PORT 3000
 
 # 使用 bash 启动应用
-CMD ["/bin/bash", "-c", "node_modules/.bin/next start"]
-# CMD ["node", "node_modules/.bin/next", "start"]
+CMD ["/bin/bash", "-c", "node_modules/.bin/next start"]