-
Notifications
You must be signed in to change notification settings - Fork 127
fix(media): serve uploaded media files and align volume mapping #1195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates 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 servingerDiagram
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"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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
websocketservice still uses the old volume mount path/datawhile thewebservice 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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'
Solves #1174
Summary by Sourcery
Align Docker volume mapping to application data directory and enable Nginx to serve uploaded media files.
Enhancements: