|
@@ -53,10 +53,16 @@ COPY --from=builder /app/package.json ./package.json
|
|
|
# 设置权限
|
|
|
RUN mkdir -p /app/public/uploads
|
|
|
RUN chown -R nextjs:nodejs /app/public/uploads
|
|
|
+RUN chmod 2775 /app/public/uploads
|
|
|
+
|
|
|
+RUN usermod -a -G nodejs nextjs
|
|
|
|
|
|
# 临时提升权限以允许写入上传目录
|
|
|
-USER root
|
|
|
-RUN chmod 777 /app/public/uploads
|
|
|
+# USER root
|
|
|
+# RUN chmod 777 /app/public/uploads
|
|
|
+
|
|
|
+# 设置 umask
|
|
|
+RUN echo "umask 0002" >> /home/nextjs/.bashrc
|
|
|
|
|
|
# 设置为非 root 用户
|
|
|
USER nextjs
|