refactor(docker): update .dockerignore and Dockerfile for improved build process

This commit is contained in:
Davidson Gomes
2025-05-05 16:37:21 -03:00
parent eb2b58c312
commit 0e90c811f8
9 changed files with 57 additions and 45 deletions

View File

@@ -1,27 +1,28 @@
FROM python:3.10-slim
# Define o diretório de trabalho
WORKDIR /app
# Define variáveis de ambiente
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app
# Instala as dependências do sistema
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
curl \
gnupg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy project files
COPY . .
# Install dependencies
RUN pip install --no-cache-dir -e .
# Configuração para produção
ENV PORT=8000 \
HOST=0.0.0.0 \
DEBUG=false
@@ -29,5 +30,4 @@ ENV PORT=8000 \
# Expose port
EXPOSE 8000
# Define o comando de inicialização
CMD alembic upgrade head && uvicorn src.main:app --host $HOST --port $PORT