From 294c1caa50d035812bc9dfa6061dadedfa5b7fb9 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Fri, 16 Dec 2022 21:28:11 +0100 Subject: [PATCH] Update run command --- {{cookiecutter.project_slug}}/Dockerfile | 3 +-- {{cookiecutter.project_slug}}/docker-compose.yaml | 1 - {{cookiecutter.project_slug}}/docker/run.sh | 4 ---- 3 files changed, 1 insertion(+), 7 deletions(-) delete mode 100755 {{cookiecutter.project_slug}}/docker/run.sh diff --git a/{{cookiecutter.project_slug}}/Dockerfile b/{{cookiecutter.project_slug}}/Dockerfile index 3ff5742..8aeeb2e 100644 --- a/{{cookiecutter.project_slug}}/Dockerfile +++ b/{{cookiecutter.project_slug}}/Dockerfile @@ -96,7 +96,6 @@ COPY --chown=django:django --from=venv $STATIC_ROOT $STATIC_ROOT WORKDIR /app COPY pyproject.toml poetry.lock ./ ADD --chown=django:django ./src ./src -ADD --chown=django:django ./docker ./docker COPY --chown=django:django tasks.py ./tasks.py @@ -110,4 +109,4 @@ WORKDIR /app/src HEALTHCHECK --start-period=30s CMD python -c "import requests; requests.get('http://localhost:8000', timeout=2)" USER django -CMD ["/app/docker/run.sh"] +CMD ["gunicorn", "{{cookiecutter.project_slug}}.wsgi", "--graceful-timeout=5", "--worker-tmp-dir=/dev/shm", "--workers=2", "--threads=4", "--worker-class=gthread", "--bind=0.0.0.0:8000", "--log-file=-"] diff --git a/{{cookiecutter.project_slug}}/docker-compose.yaml b/{{cookiecutter.project_slug}}/docker-compose.yaml index b74981f..dd775f5 100644 --- a/{{cookiecutter.project_slug}}/docker-compose.yaml +++ b/{{cookiecutter.project_slug}}/docker-compose.yaml @@ -4,7 +4,6 @@ services: django: build: . image: crocmagnon/{{cookiecutter.project_slug}} - command: /app/src/manage.py runserver 0.0.0.0:8000 env_file: - envs/docker-local-envs.env volumes: diff --git a/{{cookiecutter.project_slug}}/docker/run.sh b/{{cookiecutter.project_slug}}/docker/run.sh deleted file mode 100755 index 17cd9fb..0000000 --- a/{{cookiecutter.project_slug}}/docker/run.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -eux -python manage.py migrate --noinput -gunicorn {{cookiecutter.project_slug}}.wsgi -b 0.0.0.0:8000 --log-file -