Files
BotVPS/Dockerfile

26 lines
632 B
Docker

FROM python:3.11-slim
# Instala dependências do sistema necessárias para áudio (ffmpeg e ALSA) e para o psutil compilar
RUN apt-get update && apt-get install -y \
ffmpeg \
gcc \
python3-dev \
docker.io \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Expõe a porta do FastAPI
EXPOSE 8000
# Script de inicialização (Roda a API web no background e o Telegram Bot polling)
RUN echo '#!/bin/bash\nuvicorn main:app --host 0.0.0.0 --port 8000 & \npython bot_logic.py\n' > start.sh
RUN chmod +x start.sh
CMD ["./start.sh"]