From a88b6b04b6c13b2d9f7f7f794680326786632a3b Mon Sep 17 00:00:00 2001 From: Yuchen Xie <4576282+mapx@users.noreply.github.com> Date: Mon, 9 Dec 2019 09:55:37 +0800 Subject: [PATCH] Speed up django image build process, and reduce its size --- .../compose/production/django/Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index b0861d60..e63241f4 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -57,13 +57,11 @@ RUN chmod +x /start-flower {%- endif %} {%- if cookiecutter.js_task_runner == 'Gulp' %} -COPY --from=client-builder /app /app +COPY --from=client-builder --chown=django:django /app /app {% else %} -COPY . /app +COPY --chown=django:django . /app {%- endif %} -RUN chown -R django /app - USER django WORKDIR /app