charles_c 5 mēneši atpakaļ
vecāks
revīzija
7711b4e900
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      Dockerfile.prod

+ 1 - 1
Dockerfile.prod

@@ -53,11 +53,11 @@ COPY --from=builder /app/package.json ./package.json
 # 创建 uploads 目录并设置权限
 # 创建 uploads 目录并设置权限
 # RUN mkdir -p /app/public/uploads && chown -R nextjs:nodejs /app/public && chown -R nextjs:nodejs /app/public/uploads
 # RUN mkdir -p /app/public/uploads && chown -R nextjs:nodejs /app/public && chown -R nextjs:nodejs /app/public/uploads
 
 
+USER root
 # 设置权限
 # 设置权限
 RUN mkdir -p /app/public/uploads
 RUN mkdir -p /app/public/uploads
 RUN chown -R nextjs:nodejs /app/public
 RUN chown -R nextjs:nodejs /app/public
 RUN chown -R nextjs:nodejs /app/public/uploads
 RUN chown -R nextjs:nodejs /app/public/uploads
-RUN chmod -R 755 /app/public/uploads
 
 
 # 设置为非 root 用户
 # 设置为非 root 用户
 USER nextjs
 USER nextjs