-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (22 loc) · 718 Bytes
/
Dockerfile
File metadata and controls
27 lines (22 loc) · 718 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
# Dockerfile
# Estágio 1: Imagem base
FROM python:3.10-slim
# Variáveis de ambiente
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Estágio 2: Instalação de dependências
WORKDIR /app
COPY requirements.txt .
RUN apt-get update && \
apt-get install -y git --no-install-recommends && \
pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Estágio 3: Cópia do código da aplicação
COPY ./api /app/api
# Estágio 4: Comando de execução
# Expõe a porta que o Uvicorn usará
EXPOSE 8000
# Inicia o servidor Uvicorn
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]