diff --git a/{{cookiecutter.project_slug}}/compose/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/django/Dockerfile index 781f9b8d9..618533f7d 100644 --- a/{{cookiecutter.project_slug}}/compose/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/django/Dockerfile @@ -1,15 +1,16 @@ 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 -RUN pip install -r /requirements/production.txt \ - && groupadd -r django \ - && useradd -r -g django django - -COPY ./compose/django/gunicorn.sh /gunicorn.sh -COPY ./compose/django/entrypoint.sh /entrypoint.sh +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 \ @@ -20,6 +21,7 @@ RUN sed -i 's/\r//' /entrypoint.sh \ COPY . /app RUN chown -R django /app + USER django WORKDIR /app diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 69d6ee366..151fcdced 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,16 +1,16 @@ # Local development dependencies go here -r base.txt -coverage==4.3.4 +coverage==4.4 django-coverage-plugin==1.5.0 Sphinx==1.5.5 -django-extensions==1.7.8 +django-extensions==1.7.9 Werkzeug==0.12.1 django-test-plus==1.0.17 factory-boy==2.8.1 -django-debug-toolbar==1.7 +django-debug-toolbar==1.8 # improved REPL ipdb==0.10.3 diff --git a/{{cookiecutter.project_slug}}/requirements/test.txt b/{{cookiecutter.project_slug}}/requirements/test.txt index 03cade464..7fdeeb4a2 100644 --- a/{{cookiecutter.project_slug}}/requirements/test.txt +++ b/{{cookiecutter.project_slug}}/requirements/test.txt @@ -7,7 +7,7 @@ psycopg2==2.7.1 {%- endif %} -coverage==4.3.4 +coverage==4.4 flake8==3.3.0 # pyup: != 2.6.0 django-test-plus==1.0.17 factory-boy==2.8.1