BoletimSed / Dockerfile
histlearn's picture
Update Dockerfile
a044811 verified
raw
history blame
1.03 kB
FROM python:3.9-slim
# Instalar dependências do sistema
RUN apt-get update && apt-get install -y \
ghostscript \
python3-opencv \
libgl1-mesa-glx \
fonts-liberation \
fontconfig \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
# Configurar diretórios e permissões para fontconfig e matplotlib
RUN mkdir -p /usr/share/fonts/truetype/liberation && \
mkdir -p /root/.cache/matplotlib && \
mkdir -p /root/.config/fontconfig && \
mkdir -p /root/.config/matplotlib && \
chmod -R 777 /root/.cache/matplotlib && \
chmod -R 777 /root/.config/fontconfig && \
chmod -R 777 /root/.config/matplotlib
# Configurar variável de ambiente para o matplotlib
ENV MPLCONFIGDIR=/root/.config/matplotlib
# Configurar diretório de trabalho
WORKDIR /code
# Copiar requirements e instalar dependências Python
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copiar o código da aplicação
COPY app.py .
# Comando para iniciar a aplicação
CMD ["python", "app.py"]