From 1b4748ae0be9d485f6bc142105ed855e7ca96b64 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 5 Sep 2020 11:11:55 +0530 Subject: [PATCH 1/8] Updated .gitlab-ci.yml file to use python 3.8 instead of 3.7. This would make it consistent with the python version used across the app. --- {{cookiecutter.project_slug}}/.gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml index 246c4c9828..83f8edf166 100644 --- a/{{cookiecutter.project_slug}}/.gitlab-ci.yml +++ b/{{cookiecutter.project_slug}}/.gitlab-ci.yml @@ -13,7 +13,7 @@ variables: flake8: stage: lint - image: python:3.7-alpine + image: python:3.8-alpine before_script: - pip install -q flake8 script: @@ -21,7 +21,7 @@ flake8: pytest: stage: test - image: python:3.7 + image: python:3.8 {% if cookiecutter.use_docker == 'y' -%} image: docker/compose:latest tags: From fbc6e75cac1290ca36ff0d2150b5739a5037c5e9 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 5 Sep 2020 11:18:49 +0530 Subject: [PATCH 2/8] Added myself to list of contributors --- CONTRIBUTORS.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 0174628e53..9617af6a54 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -264,6 +264,13 @@ Listed in alphabetical order. + + Arnav Choudhury + + arnav13081994 + + + AsheKR @@ -1463,4 +1470,4 @@ guidance and advice. - Jannis Leidel - Nate Aune -- Barry Morrison \ No newline at end of file +- Barry Morrison From 4410d9ea38680d0cd08049a1300fcc1c9e0ec755 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 5 Sep 2020 11:29:54 +0530 Subject: [PATCH 3/8] Made gitlab-ci use the same postgresql version as the user selected at project creation time. --- {{cookiecutter.project_slug}}/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml index 83f8edf166..60925b811c 100644 --- a/{{cookiecutter.project_slug}}/.gitlab-ci.yml +++ b/{{cookiecutter.project_slug}}/.gitlab-ci.yml @@ -39,7 +39,7 @@ pytest: tags: - python services: - - postgres:11 + - postgres:{{ cookiecutter.postgresql_version }} variables: DATABASE_URL: pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres/$POSTGRES_DB From 1676d1ad548aa11b4163c90a17df29907ed7564e Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 5 Sep 2020 14:03:12 +0530 Subject: [PATCH 4/8] Removed entry from CONTRIBUTORS.md file --- CONTRIBUTORS.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9617af6a54..2d17cddfe3 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -264,13 +264,6 @@ Listed in alphabetical order. - - Arnav Choudhury - - arnav13081994 - - - AsheKR From 7dacf4995c73e8ca411f089aec97557b4e4e7117 Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 5 Sep 2020 14:16:31 +0530 Subject: [PATCH 5/8] Reduced number of Django Image layers by changing directory ownership with directory copying step. --- .../compose/production/django/Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 72f71d6ec7..2e6a195b7c 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -32,26 +32,26 @@ COPY ./requirements /requirements RUN pip install --no-cache-dir -r /requirements/production.txt \ && rm -rf /requirements -COPY ./compose/production/django/entrypoint /entrypoint +COPY --chown=django:django ./compose/production/django/entrypoint /entrypoint RUN sed -i 's/\r$//g' /entrypoint RUN chmod +x /entrypoint -RUN chown django /entrypoint -COPY ./compose/production/django/start /start + +COPY --chown=django:django ./compose/production/django/start /start RUN sed -i 's/\r$//g' /start RUN chmod +x /start -RUN chown django /start + {%- if cookiecutter.use_celery == "y" %} -COPY ./compose/production/django/celery/worker/start /start-celeryworker +COPY --chown=django:django ./compose/production/django/celery/worker/start /start-celeryworker RUN sed -i 's/\r$//g' /start-celeryworker RUN chmod +x /start-celeryworker -RUN chown django /start-celeryworker -COPY ./compose/production/django/celery/beat/start /start-celerybeat + +COPY --chown=django:django ./compose/production/django/celery/beat/start /start-celerybeat RUN sed -i 's/\r$//g' /start-celerybeat RUN chmod +x /start-celerybeat -RUN chown django /start-celerybeat + COPY ./compose/production/django/celery/flower/start /start-flower RUN sed -i 's/\r$//g' /start-flower From 5f066e38da5bfa5574be7a77391bfa791acc0aac Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Sat, 5 Sep 2020 14:20:01 +0530 Subject: [PATCH 6/8] reduced number of layers in Traefik by combining directory and file creation and file permissions steps together. If anyone fails, the entire build should fail anyway. --- .../compose/production/traefik/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile index 746aa2b48e..26a653d504 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile @@ -1,5 +1,5 @@ FROM traefik:v2.0 -RUN mkdir -p /etc/traefik/acme -RUN touch /etc/traefik/acme/acme.json -RUN chmod 600 /etc/traefik/acme/acme.json +RUN mkdir -p /etc/traefik/acme \ + && touch /etc/traefik/acme/acme.json \ + && chmod 600 /etc/traefik/acme/acme.json COPY ./compose/production/traefik/traefik.yml /etc/traefik From 41940bb1c1166acebe844f1ec37f04d87d22dc1e Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Mon, 7 Sep 2020 20:42:08 +0530 Subject: [PATCH 7/8] Pulling changes from remote upstream --- {{cookiecutter.project_slug}}/config/settings/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index f69908c2da..6f03774f46 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -332,3 +332,4 @@ {%- endif %} # Your stuff... # ------------------------------------------------------------------------------ + From c43d6d12931446ae4f970aace402d350c6b4801d Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Mon, 7 Sep 2020 20:44:03 +0530 Subject: [PATCH 8/8] Reducing number of layers in the Django and Traefik images by combining Run commands as well as changing owneship while copying files. --- {{cookiecutter.project_slug}}/config/settings/base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 6f03774f46..f69908c2da 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -332,4 +332,3 @@ {%- endif %} # Your stuff... # ------------------------------------------------------------------------------ -