From 2fc3bfd442bc3b029bc6e8b8cf618b7f5a364c0f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 2 Sep 2017 08:06:36 +0200 Subject: [PATCH 01/27] Update tox from 2.7.0 to 2.8.0 (#1313) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b87473c1..b6f1a0af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,5 @@ binaryornot==0.4.4 pytest==3.2.1 pep8==1.7.0 pyflakes==1.6.0 -tox==2.7.0 +tox==2.8.0 pytest-cookies==0.2.0 From ae9f951f451356c825617cf8402df29af37c9f84 Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Sat, 2 Sep 2017 20:42:07 +0300 Subject: [PATCH 02/27] Use Unix, not Windows environment variable format in Caddyfile (#1314) Closes #1310. --- {{cookiecutter.project_slug}}/compose/caddy/Caddyfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/caddy/Caddyfile b/{{cookiecutter.project_slug}}/compose/caddy/Caddyfile index 22ec73f4..d36632e4 100644 --- a/{{cookiecutter.project_slug}}/compose/caddy/Caddyfile +++ b/{{cookiecutter.project_slug}}/compose/caddy/Caddyfile @@ -1,8 +1,8 @@ -www.{% raw %}{%DOMAIN_NAME%}{% endraw %} { +www.{% raw %}{$DOMAIN_NAME}{% endraw %} { redir https://{{cookiecutter.domain_name}} } -{% raw %}{%DOMAIN_NAME%}{% endraw %} { +{% raw %}{$DOMAIN_NAME}{% endraw %} { proxy / django:5000 { header_upstream Host {host} header_upstream X-Real-IP {remote} From 7aa99c6ae32d3ea6f94fcece3158c7fc88b692a8 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 4 Sep 2017 19:24:44 +0200 Subject: [PATCH 03/27] Update tox from 2.8.0 to 2.8.1 (#1318) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b6f1a0af..909f1adc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,5 @@ binaryornot==0.4.4 pytest==3.2.1 pep8==1.7.0 pyflakes==1.6.0 -tox==2.8.0 +tox==2.8.1 pytest-cookies==0.2.0 From 188ff966f8fc169d41fa8d1b074b4417e273ab69 Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Tue, 5 Sep 2017 14:39:20 +0300 Subject: [PATCH 04/27] Re-organize compose/ into environment-specific file groups (#1317) * Re-organize compose/ into environment-specific file groups Closes #1316. * Commit missing files That was weird: git failed to commit one specific folder previously --- .../compose/caddy/Dockerfile | 2 - .../compose/django/Dockerfile | 29 -------------- .../compose/django/Dockerfile-local | 26 ------------- .../compose/django/start-dev.sh | 3 -- .../compose/local/django/Dockerfile | 27 +++++++++++++ .../django/celery/beat/start.sh} | 4 +- .../django/celery/worker/start.sh} | 4 +- .../compose/local/django/start.sh | 10 +++++ .../compose/postgres/Dockerfile | 11 ------ .../compose/{ => production}/caddy/Caddyfile | 0 .../compose/production/caddy/Dockerfile | 3 ++ .../compose/production/django/Dockerfile | 39 +++++++++++++++++++ .../production/django/celery/beat/start.sh | 8 ++++ .../production/django/celery/worker/start.sh | 8 ++++ .../{ => production}/django/entrypoint.sh | 11 +++++- .../{ => production}/django/gunicorn.sh | 10 ++++- .../compose/production/postgres/Dockerfile | 9 +++++ .../{ => production}/postgres/backup.sh | 9 +++-- .../{ => production}/postgres/list-backups.sh | 8 +++- .../{ => production}/postgres/restore.sh | 8 ++-- {{cookiecutter.project_slug}}/local.yml | 22 ++++++----- {{cookiecutter.project_slug}}/production.yml | 34 ++++++++-------- .../requirements/production.txt | 4 +- 23 files changed, 175 insertions(+), 114 deletions(-) delete mode 100644 {{cookiecutter.project_slug}}/compose/caddy/Dockerfile delete mode 100644 {{cookiecutter.project_slug}}/compose/django/Dockerfile delete mode 100644 {{cookiecutter.project_slug}}/compose/django/Dockerfile-local delete mode 100644 {{cookiecutter.project_slug}}/compose/django/start-dev.sh create mode 100644 {{cookiecutter.project_slug}}/compose/local/django/Dockerfile rename {{cookiecutter.project_slug}}/compose/{django/celery/beat/start-dev.sh => local/django/celery/beat/start.sh} (78%) rename {{cookiecutter.project_slug}}/compose/{django/celery/worker/start-dev.sh => local/django/celery/worker/start.sh} (74%) create mode 100644 {{cookiecutter.project_slug}}/compose/local/django/start.sh delete mode 100644 {{cookiecutter.project_slug}}/compose/postgres/Dockerfile rename {{cookiecutter.project_slug}}/compose/{ => production}/caddy/Caddyfile (100%) create mode 100644 {{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile create mode 100644 {{cookiecutter.project_slug}}/compose/production/django/Dockerfile create mode 100644 {{cookiecutter.project_slug}}/compose/production/django/celery/beat/start.sh create mode 100644 {{cookiecutter.project_slug}}/compose/production/django/celery/worker/start.sh rename {{cookiecutter.project_slug}}/compose/{ => production}/django/entrypoint.sh (91%) rename {{cookiecutter.project_slug}}/compose/{ => production}/django/gunicorn.sh (59%) create mode 100644 {{cookiecutter.project_slug}}/compose/production/postgres/Dockerfile rename {{cookiecutter.project_slug}}/compose/{ => production}/postgres/backup.sh (90%) rename {{cookiecutter.project_slug}}/compose/{ => production}/postgres/list-backups.sh (53%) rename {{cookiecutter.project_slug}}/compose/{ => production}/postgres/restore.sh (96%) diff --git a/{{cookiecutter.project_slug}}/compose/caddy/Dockerfile b/{{cookiecutter.project_slug}}/compose/caddy/Dockerfile deleted file mode 100644 index 774b0bf5..00000000 --- a/{{cookiecutter.project_slug}}/compose/caddy/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM abiosoft/caddy:0.10.6 -COPY Caddyfile /etc/Caddyfile diff --git a/{{cookiecutter.project_slug}}/compose/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/django/Dockerfile deleted file mode 100644 index 618533f7..00000000 --- a/{{cookiecutter.project_slug}}/compose/django/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM python:3.5 - -ENV PYTHONUNBUFFERED 1 - -RUN groupadd -r django \ - && useradd -r -g django django - -# Requirements have to be pulled and installed here, otherwise caching won't work -COPY ./requirements /requirements -RUN pip install --no-cache-dir -r /requirements/production.txt \ - && rm -rf /requirements - -COPY ./compose/django/gunicorn.sh ./compose/django/entrypoint.sh / -RUN sed -i 's/\r//' /entrypoint.sh \ - && sed -i 's/\r//' /gunicorn.sh \ - && chmod +x /entrypoint.sh \ - && chown django /entrypoint.sh \ - && chmod +x /gunicorn.sh \ - && chown django /gunicorn.sh - -COPY . /app - -RUN chown -R django /app - -USER django - -WORKDIR /app - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/{{cookiecutter.project_slug}}/compose/django/Dockerfile-local b/{{cookiecutter.project_slug}}/compose/django/Dockerfile-local deleted file mode 100644 index d2c56532..00000000 --- a/{{cookiecutter.project_slug}}/compose/django/Dockerfile-local +++ /dev/null @@ -1,26 +0,0 @@ -FROM python:3.5 -ENV PYTHONUNBUFFERED 1 - -# Requirements have to be pulled and installed here, otherwise caching won't work -COPY ./requirements /requirements -RUN pip install -r /requirements/local.txt - -COPY ./compose/django/entrypoint.sh /entrypoint.sh -RUN sed -i 's/\r//' /entrypoint.sh -RUN chmod +x /entrypoint.sh - -COPY ./compose/django/start-dev.sh /start-dev.sh -RUN sed -i 's/\r//' /start-dev.sh -RUN chmod +x /start-dev.sh - -COPY ./compose/django/celery/worker/start-dev.sh /start-celeryworker-dev.sh -RUN sed -i 's/\r//' /start-celeryworker-dev.sh -RUN chmod +x /start-celeryworker-dev.sh - -COPY ./compose/django/celery/beat/start-dev.sh /start-celerybeat-dev.sh -RUN sed -i 's/\r//' /start-celerybeat-dev.sh -RUN chmod +x /start-celerybeat-dev.sh - -WORKDIR /app - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/{{cookiecutter.project_slug}}/compose/django/start-dev.sh b/{{cookiecutter.project_slug}}/compose/django/start-dev.sh deleted file mode 100644 index 04e06981..00000000 --- a/{{cookiecutter.project_slug}}/compose/django/start-dev.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -python manage.py migrate -python manage.py runserver_plus 0.0.0.0:8000 diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile new file mode 100644 index 00000000..e62b524a --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -0,0 +1,27 @@ +FROM python:3.5 + +ENV PYTHONUNBUFFERED 1 + +# Requirements have to be pulled and installed here, otherwise caching won't work +COPY ./requirements /requirements +RUN pip install -r /requirements/local.txt + +COPY ./compose/production/django/entrypoint.sh /entrypoint.sh +RUN sed -i 's/\r//' /entrypoint.sh +RUN chmod +x /entrypoint.sh + +COPY ./compose/local/django/start.sh /start.sh +RUN sed -i 's/\r//' /start.sh +RUN chmod +x /start.sh + +COPY ./compose/local/django/celery/worker/start.sh /start-celeryworker.sh +RUN sed -i 's/\r//' /start-celeryworker.sh +RUN chmod +x /start-celeryworker.sh + +COPY ./compose/local/django/celery/beat/start.sh /start-celerybeat.sh +RUN sed -i 's/\r//' /start-celerybeat.sh +RUN chmod +x /start-celerybeat.sh + +WORKDIR /app + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/{{cookiecutter.project_slug}}/compose/django/celery/beat/start-dev.sh b/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start.sh similarity index 78% rename from {{cookiecutter.project_slug}}/compose/django/celery/beat/start-dev.sh rename to {{cookiecutter.project_slug}}/compose/local/django/celery/beat/start.sh index 987d7259..c26318b4 100644 --- a/{{cookiecutter.project_slug}}/compose/django/celery/beat/start-dev.sh +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start.sh @@ -1,8 +1,10 @@ -#!/bin/sh +#!/usr/bin/env bash set -o errexit +set -o pipefail set -o nounset set -o xtrace + rm -f './celerybeat.pid' celery -A {{cookiecutter.project_slug}}.taskapp beat -l INFO diff --git a/{{cookiecutter.project_slug}}/compose/django/celery/worker/start-dev.sh b/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start.sh similarity index 74% rename from {{cookiecutter.project_slug}}/compose/django/celery/worker/start-dev.sh rename to {{cookiecutter.project_slug}}/compose/local/django/celery/worker/start.sh index 594065e6..8b50c8cf 100644 --- a/{{cookiecutter.project_slug}}/compose/django/celery/worker/start-dev.sh +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start.sh @@ -1,7 +1,9 @@ -#!/bin/sh +#!/usr/bin/env bash set -o errexit +set -o pipefail set -o nounset set -o xtrace + celery -A {{cookiecutter.project_slug}}.taskapp worker -l INFO diff --git a/{{cookiecutter.project_slug}}/compose/local/django/start.sh b/{{cookiecutter.project_slug}}/compose/local/django/start.sh new file mode 100644 index 00000000..cf4a4166 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/local/django/start.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset +set -o xtrace + + +python manage.py migrate +python manage.py runserver_plus 0.0.0.0:8000 diff --git a/{{cookiecutter.project_slug}}/compose/postgres/Dockerfile b/{{cookiecutter.project_slug}}/compose/postgres/Dockerfile deleted file mode 100644 index 9cdaaba3..00000000 --- a/{{cookiecutter.project_slug}}/compose/postgres/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM postgres:{{ cookiecutter.postgresql_version }} - -# add backup scripts -ADD backup.sh /usr/local/bin/backup -ADD restore.sh /usr/local/bin/restore -ADD list-backups.sh /usr/local/bin/list-backups - -# make them executable -RUN chmod +x /usr/local/bin/restore -RUN chmod +x /usr/local/bin/list-backups -RUN chmod +x /usr/local/bin/backup diff --git a/{{cookiecutter.project_slug}}/compose/caddy/Caddyfile b/{{cookiecutter.project_slug}}/compose/production/caddy/Caddyfile similarity index 100% rename from {{cookiecutter.project_slug}}/compose/caddy/Caddyfile rename to {{cookiecutter.project_slug}}/compose/production/caddy/Caddyfile diff --git a/{{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile new file mode 100644 index 00000000..d02f0342 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile @@ -0,0 +1,3 @@ +FROM abiosoft/caddy:0.10.6 + +COPY ./compose/production/caddy/Caddyfile /etc/Caddyfile diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile new file mode 100644 index 00000000..fcbe5184 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -0,0 +1,39 @@ +FROM python:3.5 + +ENV PYTHONUNBUFFERED 1 + +RUN groupadd -r django \ + && useradd -r -g django django + +# Requirements have to be pulled and installed here, otherwise caching won't work +COPY ./requirements /requirements +RUN pip install --no-cache-dir -r /requirements/production.txt \ + && rm -rf /requirements + +COPY ./compose/production/django/gunicorn.sh /gunicorn.sh +RUN sed -i 's/\r//' /gunicorn.sh +RUN chmod +x /gunicorn.sh +RUN chown django /gunicorn.sh + +COPY ./compose/production/django/entrypoint.sh /entrypoint.sh +RUN sed -i 's/\r//' /entrypoint.sh +RUN chmod +x /entrypoint.sh +RUN chown django /entrypoint.sh + +COPY ./compose/production/django/celery/worker/start.sh /start-celeryworker.sh +RUN sed -i 's/\r//' /start-celeryworker.sh +RUN chmod +x /start-celeryworker.sh + +COPY ./compose/production/django/celery/beat/start.sh /start-celerybeat.sh +RUN sed -i 's/\r//' /start-celerybeat.sh +RUN chmod +x /start-celerybeat.sh + +COPY . /app + +RUN chown -R django /app + +USER django + +WORKDIR /app + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start.sh b/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start.sh new file mode 100644 index 00000000..845db0a3 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset + + +celery -A {{cookiecutter.project_slug}}.taskapp beat -l INFO diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start.sh b/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start.sh new file mode 100644 index 00000000..4529aad9 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset + + +celery -A {{cookiecutter.project_slug}}.taskapp worker -l INFO diff --git a/{{cookiecutter.project_slug}}/compose/django/entrypoint.sh b/{{cookiecutter.project_slug}}/compose/production/django/entrypoint.sh similarity index 91% rename from {{cookiecutter.project_slug}}/compose/django/entrypoint.sh rename to {{cookiecutter.project_slug}}/compose/production/django/entrypoint.sh index 9fe7f5c8..3b83c7bb 100644 --- a/{{cookiecutter.project_slug}}/compose/django/entrypoint.sh +++ b/{{cookiecutter.project_slug}}/compose/production/django/entrypoint.sh @@ -1,5 +1,12 @@ -#!/bin/bash -set -e +#!/usr/bin/env bash + +set -o errexit +set -o pipefail + +# todo: turn on after #1295 +# set -o nounset + + cmd="$@" # This entrypoint is used to play nicely with the current cookiecutter configuration. diff --git a/{{cookiecutter.project_slug}}/compose/django/gunicorn.sh b/{{cookiecutter.project_slug}}/compose/production/django/gunicorn.sh similarity index 59% rename from {{cookiecutter.project_slug}}/compose/django/gunicorn.sh rename to {{cookiecutter.project_slug}}/compose/production/django/gunicorn.sh index 014f173e..25da0649 100644 --- a/{{cookiecutter.project_slug}}/compose/django/gunicorn.sh +++ b/{{cookiecutter.project_slug}}/compose/production/django/gunicorn.sh @@ -1,3 +1,9 @@ -#!/bin/sh +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset + + python /app/manage.py collectstatic --noinput -/usr/local/bin/gunicorn config.wsgi -w 4 -b 0.0.0.0:5000 --chdir=/app \ No newline at end of file +/usr/local/bin/gunicorn config.wsgi -w 4 -b 0.0.0.0:5000 --chdir=/app diff --git a/{{cookiecutter.project_slug}}/compose/production/postgres/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/postgres/Dockerfile new file mode 100644 index 00000000..769f7989 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/production/postgres/Dockerfile @@ -0,0 +1,9 @@ +FROM postgres:{{ cookiecutter.postgresql_version }} + +ADD ./compose/production/postgres/backup.sh /usr/local/bin/backup +ADD ./compose/production/postgres/restore.sh /usr/local/bin/restore +ADD ./compose/production/postgres/list-backups.sh /usr/local/bin/list-backups + +RUN chmod +x /usr/local/bin/restore +RUN chmod +x /usr/local/bin/list-backups +RUN chmod +x /usr/local/bin/backup diff --git a/{{cookiecutter.project_slug}}/compose/postgres/backup.sh b/{{cookiecutter.project_slug}}/compose/production/postgres/backup.sh similarity index 90% rename from {{cookiecutter.project_slug}}/compose/postgres/backup.sh rename to {{cookiecutter.project_slug}}/compose/production/postgres/backup.sh index 47f7a514..46438011 100644 --- a/{{cookiecutter.project_slug}}/compose/postgres/backup.sh +++ b/{{cookiecutter.project_slug}}/compose/production/postgres/backup.sh @@ -1,6 +1,9 @@ -#!/bin/bash -# stop on errors -set -e +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset + # we might run into trouble when using the default `postgres` user, e.g. when dropping the postgres # database in restore.sh. Check that something else is used here diff --git a/{{cookiecutter.project_slug}}/compose/postgres/list-backups.sh b/{{cookiecutter.project_slug}}/compose/production/postgres/list-backups.sh similarity index 53% rename from {{cookiecutter.project_slug}}/compose/postgres/list-backups.sh rename to {{cookiecutter.project_slug}}/compose/production/postgres/list-backups.sh index 75972b75..2be3d1d6 100644 --- a/{{cookiecutter.project_slug}}/compose/postgres/list-backups.sh +++ b/{{cookiecutter.project_slug}}/compose/production/postgres/list-backups.sh @@ -1,4 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset + + echo "listing available backups" echo "-------------------------" ls /backups/ diff --git a/{{cookiecutter.project_slug}}/compose/postgres/restore.sh b/{{cookiecutter.project_slug}}/compose/production/postgres/restore.sh similarity index 96% rename from {{cookiecutter.project_slug}}/compose/postgres/restore.sh rename to {{cookiecutter.project_slug}}/compose/production/postgres/restore.sh index ddfc90d5..e7358949 100644 --- a/{{cookiecutter.project_slug}}/compose/postgres/restore.sh +++ b/{{cookiecutter.project_slug}}/compose/production/postgres/restore.sh @@ -1,7 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash + +set -o errexit +set -o pipefail +set -o nounset -# stop on errors -set -e # we might run into trouble when using the default `postgres` user, e.g. when dropping the postgres # database in restore.sh. Check that something else is used here diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index 0fbb4436..aaf131fa 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -1,14 +1,14 @@ version: '2' volumes: - postgres_data_dev: {} - postgres_backup_dev: {} + postgres_data_local: {} + postgres_backup_local: {} services: - django: &django + django:{% if cookiecutter.use_celery == 'y' %} &django{% endif %} build: context: . - dockerfile: ./compose/django/Dockerfile-local + dockerfile: ./compose/local/django/Dockerfile depends_on: - postgres{% if cookiecutter.use_mailhog == 'y' %} - mailhog{% endif %} @@ -19,13 +19,15 @@ services: - USE_DOCKER=yes ports: - "8000:8000" - command: /start-dev.sh + command: /start.sh postgres: - build: ./compose/postgres + build: + context: . + dockerfile: ./compose/production/postgres/Dockerfile volumes: - - postgres_data_dev:/var/lib/postgresql/data - - postgres_backup_dev:/backups + - postgres_data_local:/var/lib/postgresql/data + - postgres_backup_local:/backups environment: - POSTGRES_USER={{cookiecutter.project_slug}} {% if cookiecutter.use_mailhog == 'y' %} @@ -46,7 +48,7 @@ services: - postgres{% if cookiecutter.use_mailhog == 'y' %} - mailhog{% endif %} ports: [] - command: /start-celeryworker-dev.sh + command: /start-celeryworker.sh celerybeat: # https://github.com/docker/compose/issues/3220 @@ -56,5 +58,5 @@ services: - postgres{% if cookiecutter.use_mailhog == 'y' %} - mailhog{% endif %} ports: [] - command: /start-celerybeat-dev.sh + command: /start-celerybeat.sh {% endif %} diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index 79e856df..ef9163e5 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -6,54 +6,52 @@ volumes: caddy: {} services: - django: + django:{% if cookiecutter.use_celery == 'y' %} &django{% endif %} build: context: . - dockerfile: ./compose/django/Dockerfile + dockerfile: ./compose/production/django/Dockerfile depends_on: - postgres - redis - command: /gunicorn.sh env_file: .env + command: /gunicorn.sh postgres: - build: ./compose/postgres + build: + context: . + dockerfile: ./compose/production/postgres/Dockerfile volumes: - postgres_data:/var/lib/postgresql/data - postgres_backup:/backups env_file: .env caddy: - build: ./compose/caddy + build: + context: . + dockerfile: ./compose/production/caddy/Dockerfile depends_on: - django - ports: - - "0.0.0.0:80:80" - - "0.0.0.0:443:443" volumes: - caddy:/root/.caddy env_file: .env + ports: + - "0.0.0.0:80:80" + - "0.0.0.0:443:443" redis: image: redis:3.0 {% if cookiecutter.use_celery == 'y' %} celeryworker: - build: - context: . - dockerfile: ./compose/django/Dockerfile - env_file: .env + <<: *django depends_on: - postgres - redis - command: celery -A {{cookiecutter.project_slug}}.taskapp worker -l INFO + command: /start-celeryworker.sh celerybeat: - build: - context: . - dockerfile: ./compose/django/Dockerfile - env_file: .env + <<: *django depends_on: - postgres - redis - command: celery -A {{cookiecutter.project_slug}}.taskapp beat -l INFO + command: /start-celerybeat.sh {% endif %} diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index b9f09ca7..a347337f 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -4,8 +4,8 @@ {% if cookiecutter.windows == 'y' -%} # Python-PostgreSQL Database Adapter -# If using Win for dev, this assumes Unix in prod -# ------------------------------------------------ +# Assuming Windows is used locally, and *nix -- in production. +# ------------------------------------------------------------ psycopg2==2.7.3.1 {%- endif %} From 433eef62e4c81384f8b2e5e9912ecbf16b3329e2 Mon Sep 17 00:00:00 2001 From: Arcuri Davide Date: Tue, 5 Sep 2017 14:21:25 +0200 Subject: [PATCH 05/27] Update bootstrap to 4.0.0-beta (#1319) * Update bootstrap to 4.0.0-beta Update cdn link for js and css. Fixed class names for navbar -https://medium.com/@lukaszholeczek/how-to-upgrade-bootstrap-4-alpha-6-to-bootstrap-4-beta-d43b4210f2a3 * Updated CONTRIBUTORS.rst Updated CONTRIBUTORS.rst --- CONTRIBUTORS.rst | 1 + .../{{cookiecutter.project_slug}}/templates/base.html | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index e46c5209..f8c57233 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -53,6 +53,7 @@ Listed in alphabetical order. Andy Rose Anna Callahan `@jazztpt`_ Antonia Blair `@antoniablair`_ @antoniablairart + Arcuri Davide `@dadokkio`_ Areski Belaid `@areski`_ Ashley Camba Barclay Gauld `@yunti`_ diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html index 960cd860..f19ff588 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html @@ -15,7 +15,7 @@ {% block css %} - + {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress css %}{% endraw %}{% endif %}{% raw %} @@ -29,7 +29,7 @@
-