From 8a7b5473ee45345042773819dba1e1ee06cf00b7 Mon Sep 17 00:00:00 2001 From: Dominique Plante Date: Mon, 12 May 2025 01:17:13 -0700 Subject: [PATCH] Fix media folder permissions prod dockerfile (#5831) --- .../compose/production/django/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 36ed09ffe..4e3434582 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -119,6 +119,11 @@ COPY --from=client-builder --chown=django:django ${APP_HOME} ${APP_HOME} COPY --chown=django:django . ${APP_HOME} {%- endif %} +{%- if cookiecutter.cloud_provider == 'None' %} +# explicitly create the media folder before changing ownership below +RUN mkdir -p ${APP_HOME}/{{ cookiecutter.project_slug }}/media +{%- endif %} + # make django owner of the WORKDIR directory as well. RUN chown -R django:django ${APP_HOME}