From 83f14cd442e71d8d320e6c4e9c52ed588f490929 Mon Sep 17 00:00:00 2001 From: Keven Date: Mon, 8 Dec 2025 12:56:47 -0300 Subject: [PATCH] 12:56 --- Dockerfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad9119b..92dc57f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # ============================== # STAGE 2 – Runtime (produção) # ============================== -# comnent´pario teste FROM python:3.12-slim AS runtime # Define diretório de trabalho @@ -31,7 +30,7 @@ COPY --from=builder /install /usr/local # Copia o restante do código da aplicação COPY . . -# Define timezone e ambiente +# Define timezone e variáveis de ambiente padrão ENV TZ=America/Sao_Paulo \ PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ @@ -40,9 +39,19 @@ ENV TZ=America/Sao_Paulo \ UVICORN_HOST=0.0.0.0 \ GUNICORN_CMD_ARGS="--log-level info --timeout 60 --graceful-timeout 30 --keep-alive 10" +# Instala utilitários para debug e health checks +RUN apt-get update && apt-get install -y --no-install-recommends curl nano \ + && rm -rf /var/lib/apt/lists/* + # Expõe a porta padrão do app EXPOSE 8000 +# ============================== +# HEALTHCHECK automático +# ============================== +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ + CMD curl -f http://localhost:8000/health || exit 1 + # ============================== # Comando de inicialização # (Gunicorn + Uvicorn Workers)