|
@@ -53,15 +53,18 @@ 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/uploads
|
|
RUN chown -R nextjs:nodejs /app/public/uploads
|
|
|
|
|
|
-# 设置为非 root 用户
|
|
|
|
|
|
+# 临时提升权限以允许写入上传目录
|
|
|
|
+USER root
|
|
|
|
+RUN chmod 777 /app/public/uploads
|
|
USER nextjs
|
|
USER nextjs
|
|
|
|
|
|
|
|
+# 设置为非 root 用户
|
|
|
|
+# USER nextjs
|
|
|
|
+
|
|
# 暴露端口
|
|
# 暴露端口
|
|
EXPOSE 3000
|
|
EXPOSE 3000
|
|
|
|
|