12:56
This commit is contained in:
parent
b5505d1162
commit
83f14cd442
1 changed files with 11 additions and 2 deletions
13
Dockerfile
13
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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue