From 259271f1908526f12317af68c166cb16fb9da004 Mon Sep 17 00:00:00 2001 From: Dominique Plante Date: Fri, 9 May 2025 13:47:40 -0700 Subject: [PATCH] Add conditional so that we only create the folder when media is served by nginx Docker service from project-generationx-options.rst -> "If you choose no cloud provider and docker, the production stack will serve the media files via an nginx Docker service" --- .../compose/production/django/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 20bdf5fa7..7188dc3c5 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -119,8 +119,10 @@ 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}