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"
This commit is contained in:
Dominique Plante 2025-05-09 13:47:40 -07:00
parent 952ca20b27
commit 259271f190

View File

@ -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}