From 8ed03e4407fbd0da97467dda56b86a98e10569ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81s=20Gonza=CC=81lez?= Date: Fri, 12 Apr 2024 14:24:12 -0300 Subject: [PATCH] fix: Create media directory in Dockerfile. If the media directory does not exist at the time that uwsgi is launched, the mapping to /media to serve media files will not be created. --- changelog.d/20240412_140658_andres.md | 1 + tutordiscovery/templates/discovery/build/discovery/Dockerfile | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 changelog.d/20240412_140658_andres.md diff --git a/changelog.d/20240412_140658_andres.md b/changelog.d/20240412_140658_andres.md new file mode 100644 index 0000000..9306f56 --- /dev/null +++ b/changelog.d/20240412_140658_andres.md @@ -0,0 +1 @@ +- [Bugfix] Fix the docker image to allow media files to be served by uwsgi. (by @angonz) \ No newline at end of file diff --git a/tutordiscovery/templates/discovery/build/discovery/Dockerfile b/tutordiscovery/templates/discovery/build/discovery/Dockerfile index 5575ec6..f6dc5f7 100644 --- a/tutordiscovery/templates/discovery/build/discovery/Dockerfile +++ b/tutordiscovery/templates/discovery/build/discovery/Dockerfile @@ -66,6 +66,9 @@ RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip, 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 +RUN mkdir course_discovery/media + # Run production server ENV DJANGO_SETTINGS_MODULE course_discovery.settings.tutor.production EXPOSE 8000