From 5d3869403d2d57d9236cdd164ee9105cbd67ee63 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 10 Nov 2022 18:27:45 +0100 Subject: [PATCH] Fix stop container --- Dockerfile | 3 +-- docker-compose.yaml | 1 - docker/run.sh | 4 ---- envs/docker-local-envs.env | 2 +- 4 files changed, 2 insertions(+), 8 deletions(-) delete mode 100755 docker/run.sh diff --git a/Dockerfile b/Dockerfile index 5aa7de3..cb37fa0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -98,7 +98,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 @@ -116,4 +115,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", "charasheet.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/docker-compose.yaml b/docker-compose.yaml index 1bb320d..8cb9c48 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,7 +4,6 @@ services: django: build: . image: crocmagnon/charasheet - command: /app/src/manage.py runserver 0.0.0.0:8000 env_file: - envs/docker-local-envs.env volumes: diff --git a/docker/run.sh b/docker/run.sh deleted file mode 100755 index 6203d74..0000000 --- a/docker/run.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -eux -python manage.py migrate --noinput -gunicorn charasheet.wsgi -b 0.0.0.0:8000 --log-file - diff --git a/envs/docker-local-envs.env b/envs/docker-local-envs.env index 4a2f2b9..7ee9770 100644 --- a/envs/docker-local-envs.env +++ b/envs/docker-local-envs.env @@ -3,7 +3,7 @@ ############################################################################### DJANGO_SETTINGS_MODULE=charasheet.settings SECRET_KEY="UkZF3iM%Fqdj6HWugPWS26q!tmquRm#8G^X#&AiXiT$r2t%N4F" -DEBUG=True +DEBUG=False ALLOWED_HOSTS=localhost,127.0.0.1 ###############################################################################