|
@@ -50,9 +50,6 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/package.json ./package.json
|
|
COPY --from=builder /app/package.json ./package.json
|
|
|
|
|
|
-# 创建 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
|
|
RUN mkdir -p /app/public/uploads
|
|
RUN chown -R nextjs:nodejs /app/public/uploads
|
|
RUN chown -R nextjs:nodejs /app/public/uploads
|
|
@@ -60,10 +57,9 @@ RUN chown -R nextjs:nodejs /app/public/uploads
|
|
# 临时提升权限以允许写入上传目录
|
|
# 临时提升权限以允许写入上传目录
|
|
USER root
|
|
USER root
|
|
RUN chmod 777 /app/public/uploads
|
|
RUN chmod 777 /app/public/uploads
|
|
-USER nextjs
|
|
|
|
|
|
|
|
# 设置为非 root 用户
|
|
# 设置为非 root 用户
|
|
-# USER nextjs
|
|
|
|
|
|
+USER nextjs
|
|
|
|
|
|
# 暴露端口
|
|
# 暴露端口
|
|
EXPOSE 3000
|
|
EXPOSE 3000
|