# CASO FOR SUBIR ESSA VERSÃO ADICIONAR PYTORCH EM requirements.txt FROM python:3.11-slim # Definindo a variável de ambiente corretamente ENV GUNICORN_WORKERS=1 # Instalação de dependências do sistema RUN apt-get update && apt-get install -y --no-install-recommends \ libpq-dev gcc curl python3-dev musl-dev \ && apt-get install -y espeak \ && rm -rf /var/lib/apt/lists/* WORKDIR /usr/src/app # Copia o arquivo de dependências e instala COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt # Installing 'resemblyzer' without dependencies using '--no-deps' to prevent it from overwriting # the currently installed version of PyTorch (pytorch + cpu). Other dependencies such as librosa, numpy, scipy, # typing, and webrtcvad are being installed normally in the 'requirements.txt' file. RUN pip install --no-cache-dir --no-deps Resemblyzer==0.1.4 # Copia o código do projeto COPY . . RUN chmod 777 ./error.log RUN chmod 777 ./requests.log RUN chmod 777 /usr/src/app/error.log RUN chmod 777 /usr/src/app/requests.log # # Expondo a porta 8000 para o Gunicorn EXPOSE 8000 # Comando para iniciar o servidor com Gunicorn, usando 'sh -c' para interpolação correta da variável CMD ["sh", "-c", "gunicorn rose_tts_api.wsgi:application --workers $GUNICORN_WORKERS --timeout 70 --bind 0.0.0.0:8000"]