FROM python:3.9-slim | |
WORKDIR /app | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends curl gcc python3-dev && \ | |
rm -rf /var/lib/apt/lists/* && \ | |
mkdir -p /data && \ | |
chmod 777 /data && \ | |
useradd -m appuser && \ | |
chown appuser:appuser /data | |
USER appuser | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY app.py config.yaml ./ | |
ENV MPLCONFIGDIR=/tmp/matplotlib | |
CMD ["python", "app.py"] |