Skip to content
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

Fix: images does not persist issue #76

Merged
merged 4 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [BugFix] Fix images(media) persistance issue by mounting media directory in volumes through patches. (by @Faraz32123)
3 changes: 2 additions & 1 deletion tutordiscovery/patches/local-docker-compose-dev-services
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ discovery:
command: ./manage.py runserver 0.0.0.0:8381
stdin_open: true
tty: true
{%- for mount in iter_mounts(MOUNTS, "discovery") %}
volumes:
- ../../data/discovery-media:/openedx/discovery/course_discovery/media
Faraz32123 marked this conversation as resolved.
Show resolved Hide resolved
{%- for mount in iter_mounts(MOUNTS, "discovery") %}
- {{ mount }}
{%- endfor %}
ports:
Expand Down
1 change: 1 addition & 0 deletions tutordiscovery/patches/local-docker-compose-services
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ discovery:
restart: unless-stopped
volumes:
- ../plugins/discovery/apps/settings/tutor:/openedx/discovery/course_discovery/settings/tutor:ro
- ../../data/discovery-media:/openedx/discovery/course_discovery/media
depends_on:
- lms
{% if RUN_MYSQL %}- mysql{% endif %}
Expand Down
3 changes: 3 additions & 0 deletions tutordiscovery/templates/discovery/build/discovery/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ COPY --chown=app:app assets.py ./course_discovery/settings/assets.py
RUN DJANGO_SETTINGS_MODULE=course_discovery.settings.assets make static

# Create media directory to serve media files
# have to change user at this step, as it gives permission error
User app
Faraz32123 marked this conversation as resolved.
Show resolved Hide resolved
RUN mkdir course_discovery/media
User root

# Run production server
ENV DJANGO_SETTINGS_MODULE=course_discovery.settings.tutor.production
Expand Down
Loading