fix: fileStorage path issues between local and staging environments
- Store relative paths in database instead of absolute paths - Reconstruct absolute paths at runtime using UPLOAD_DIR env var - Add VOLUME for /app/uploads in Dockerfile for persistent storage - Create uploads directory with proper permissions in Docker - Add error handling for missing UPLOAD_DIR in findUniq.ts - Simplify GitHub workflow memory in QWEN.md (manual handling) This fixes the 500 errors on staging for file create/delete operations caused by environment-specific absolute paths stored in database. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -61,8 +61,14 @@ COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/next.config.* ./
|
||||
COPY --chmod=755 docker-entrypoint.sh ./docker-entrypoint.sh
|
||||
|
||||
# Create uploads directory with proper permissions
|
||||
RUN mkdir -p /app/uploads && chown nextjs:nodejs /app/uploads
|
||||
|
||||
USER nextjs
|
||||
|
||||
# Persistent storage for uploaded files
|
||||
VOLUME ["/app/uploads"]
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["/app/docker-entrypoint.sh"]
|
||||
Reference in New Issue
Block a user