TimberlineWeather / Dockerfile
nakas's picture
Update Dockerfile
39f1cb1 verified
raw
history blame contribute delete
725 Bytes
FROM python:3.9-slim
# Install required packages
RUN apt-get update && apt-get install -y \
chromium \
chromium-driver \
fonts-dejavu \
libfontconfig1 \
&& rm -rf /var/lib/apt/lists/*
# Set environment variables for Fontconfig and Matplotlib
ENV MPLCONFIGDIR=/tmp/matplotlib
ENV FONTCONFIG_PATH=/etc/fonts
ENV HOME=/root
# Create Fontconfig cache directory and set permissions
RUN mkdir -p /root/.cache/fontconfig && chmod -R 777 /root/.cache/fontconfig
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY . /app
WORKDIR /app
# Generate Fontconfig cache
RUN fc-cache -f -v
# Run application
CMD ["python", "app.py"]