File size: 1,345 Bytes
f1e30a7
 
 
 
 
 
3e7a652
f1e30a7
 
 
 
3e7a652
 
 
 
f1e30a7
 
3e7a652
5b545cc
 
 
 
3e7a652
f1e30a7
3e7a652
d514a60
 
 
 
 
3e7a652
 
f1e30a7
3e7a652
f1e30a7
6077060
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 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"]