Refactor image upload handling by moving upload directory outside of public folder for better compatibility with Next.js. Update related Docker configurations and scripts to reflect new upload paths. Replace instances of Next.js Image component with CmsImage for consistent image handling across the application.

This commit is contained in:
smhk1376 committed 2026-10-22 12:51:18 +03:30
1 parent 0a57ef2b80
commit 1641edfd01
19 files changed
+162 -39

No files matched your search

+5 -2
View File
@@ -36,8 +36,11 @@ COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Writable dir for admin image uploads (mount a volume in compose for persistence)
RUN mkdir -p ./public/uploads && chown -R nextjs:nodejs ./public/uploads
# Writable dir for admin image uploads (mount a volume in compose for persistence).
# Keep this outside public/: Next standalone does not serve runtime public files.
RUN rm -rf ./public/uploads \
&& mkdir -p ./uploads \
&& chown -R nextjs:nodejs ./uploads
USER nextjs