Skip to content

Conversation

@Sak1012
Copy link
Member

@Sak1012 Sak1012 commented Nov 4, 2025

Solves #1174

Summary by Sourcery

Align Docker volume mapping to application data directory and enable Nginx to serve uploaded media files.

Enhancements:

  • Update Docker Compose to mount the data directory at the correct application path
  • Configure Nginx to serve uploaded media files
  • Fix media file serving issue by adjusting volume mapping and server config

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 4, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates Docker Compose volume mapping to align the data directory with the application path and enhances the Nginx configuration to correctly serve uploaded media files.

Entity relationship diagram for media file serving

erDiagram
  HOST {
    string data_static
    string data_data
    string eventyay_cfg
  }
  CONTAINER {
    string static_dist
    string data
    string eventyay_cfg
  }
  HOST ||--|| CONTAINER : "volume mapping"
  NGINX {
    string static_files
    string media_files
  }
  CONTAINER ||--o| NGINX : "serves files"
Loading

File-Level Changes

Change Details Files
Align Docker volume mapping for application data
  • Change container mount point from /data to /home/app/web/eventyay/data
  • Ensure host data volume persists under the application’s data directory
deployment/docker-compose.yml
Serve uploaded media files via Nginx
  • Add media location block to route /media requests to the data directory
  • Configure appropriate headers and caching for media assets
deployment/nginx/enext-direct

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR configures media file serving through nginx by updating volume mounts and adding a dedicated nginx location block for media files.

Key changes:

  • Added nginx /media/ location block to serve user-uploaded media files with caching and optimized logging
  • Updated Docker volume mount path for the web service to align with the application's data directory structure

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
deployment/nginx/enext-direct Added /media/ location block to serve media files with 30-day cache expiry and disabled access logs
deployment/docker-compose.yml Updated volume mount path from /data to /home/app/web/eventyay/data for consistency
Comments suppressed due to low confidence (1)

deployment/docker-compose.yml:27

  • The websocket service still uses the old volume mount path /data while the web service was updated to /home/app/web/eventyay/data. This inconsistency may cause the websocket service to fail accessing media files. Consider updating this mount to match the new path.
      - ./data/data:/data

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

volumes:
- ./data/static:/home/app/web/eventyay/static.dist
- ./data/data:/data
- ./data/data:/home/app/web/eventyay/data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? The config file eventyay.cfg defines a different directory as far as I remember?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but the MEDIA_ROOT in settings.py resolves it to a different location

BASE_DIR = Path(__file__).resolve().parent.parent
DATA_DIR = BASE_DIR / 'data'
LOG_DIR = os.path.join(DATA_DIR, 'logs')
MEDIA_ROOT = DATA_DIR / 'media'

@norbusan norbusan merged commit 699b9fa into fossasia:enext Nov 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants