From e13db8d469fc0a60272d5552f206c5fa76591f19 Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Sat, 19 Apr 2025 20:29:40 -0300 Subject: [PATCH] docker: healthcheck --- Dockerfile | 5 ++--- docker-compose.yml | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e63d007..51687cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,11 +8,10 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . . RUN python gestaoRaul/manage.py collectstatic --noinput -RUN python gestaoRaul/manage.py migrate --noinput +# RUN python gestaoRaul/manage.py migrate --noinput WORKDIR /app/gestaoRaul - -CMD [ "gunicorn", "gestaoRaul.wsgi:application", "--bind", "0.0.0.0:8000" ] +CMD [ "gunicorn", "-w", "4", "--timeout", "15", "gestaoRaul.wsgi:application", "--bind", "0.0.0.0:8000" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b492c58..fd4d281 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,14 @@ services: dockerfile: Dockerfile ports: - "8000:8000" + + healthcheck: + test: ["CMD", "curl", "-f", "http://0.0.0.0:8000/"] + interval: 5m + timeout: 3s + retries: 3 + restart: on-failure + volumes: - static_volume:/app/gestaoRaul/static environment: