Commit inicial - upload de todos os arquivos da pasta
This commit is contained in:
46
Dockerfile
Normal file
46
Dockerfile
Normal file
@@ -0,0 +1,46 @@
|
||||
# Dockerfile para Monitor Evolution API + Webhook
|
||||
# Deploy otimizado para Coolify
|
||||
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Definir diretório de trabalho
|
||||
WORKDIR /app
|
||||
|
||||
# Variáveis de ambiente para Python
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# Variáveis de ambiente para Streamlit
|
||||
ENV STREAMLIT_SERVER_PORT=3000
|
||||
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
||||
ENV STREAMLIT_SERVER_HEADLESS=true
|
||||
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
|
||||
|
||||
# Instalar dependências do sistema
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Atualizar pip
|
||||
RUN pip install --no-cache-dir --upgrade pip
|
||||
|
||||
# Copiar arquivos da aplicação
|
||||
COPY app.py monitor_logic.py ./
|
||||
|
||||
# Copiar requirements.txt se existir, caso contrário instalar dependências diretamente
|
||||
COPY requirements.txt* ./
|
||||
RUN if [ -f requirements.txt ]; then \
|
||||
pip install --no-cache-dir -r requirements.txt; \
|
||||
else \
|
||||
pip install --no-cache-dir streamlit>=1.28.0 requests>=2.31.0 python-dotenv>=1.0.0 apscheduler>=3.10.0 pandas>=2.0.0; \
|
||||
fi
|
||||
|
||||
# Expor porta do Streamlit (padrão Coolify)
|
||||
EXPOSE 3000
|
||||
|
||||
# Healthcheck para Coolify
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl --fail http://localhost:3000/_stcore/health || exit 1
|
||||
|
||||
# Comando para iniciar a aplicação na porta 3000
|
||||
CMD ["streamlit", "run", "app.py", "--server.port=3000", "--server.address=0.0.0.0"]
|
||||
Reference in New Issue
Block a user