-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 966 Bytes
/
Dockerfile
File metadata and controls
32 lines (25 loc) · 966 Bytes
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
# Usa uma imagem base oficial do Python, versão slim para ser mais leve
FROM python:3.10.12-slim
# Instala dependências do sistema
RUN apt-get update && apt-get install -y \
libpq-dev \
gcc \
python3-dev \
procps \
build-essential \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Define o diretório de trabalho da aplicação
WORKDIR /usr/src/app
# Copia somente o arquivo de dependências
COPY requirements.txt .
# Instala as dependências do Python de forma otimizada
RUN pip install --upgrade pip setuptools wheel && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir uvicorn && \
pip install --no-cache-dir aioredis && \
pip install --no-cache-dir python-dotenv && \
python -m spacy download en_core_web_sm
# Cria um diretório para armazenar os scripts de inicialização e reinício
RUN mkdir -p /home/scripts
# Expõe as portas necessárias
EXPOSE 9000 9001 9002 9003 9004 9005