charles_c 5 months ago
parent
commit
75e945c48b
1 changed files with 4 additions and 3 deletions
  1. 4 3
      Dockerfile.prod

+ 4 - 3
Dockerfile.prod

@@ -55,14 +55,15 @@ COPY --from=builder /app/package.json ./package.json
 
 
 # 设置权限
 # 设置权限
 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/uploads
 RUN chown -R nextjs:nodejs /app/public/uploads
-RUN chmod 2775 /app/public/uploads
+# RUN chmod 2775 /app/public/uploads
 
 
 # RUN usermod -a -G nodejs nextjs
 # RUN usermod -a -G nodejs nextjs
 
 
 # 临时提升权限以允许写入上传目录
 # 临时提升权限以允许写入上传目录
-# USER root
-# RUN chmod 777 /app/public/uploads
+USER root
+RUN chmod 777 /app/public/uploads
 
 
 # 设置 umask
 # 设置 umask
 RUN echo "umask 0002" >> /home/nextjs/.bashrc
 RUN echo "umask 0002" >> /home/nextjs/.bashrc