|
|
|
FROM python:3.9-slim |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
libgl1-mesa-glx \ |
|
libglib2.0-0 \ |
|
gcc \ |
|
g++ \ |
|
python3-tk \ |
|
tk-dev \ |
|
ffmpeg \ |
|
fonts-liberation \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY . /app |
|
|
|
|
|
RUN pip install --upgrade pip |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 |
|
ENV LANG=C.UTF-8 |
|
ENV LC_ALL=C.UTF-8 |
|
ENV MPLCONFIGDIR=/tmp/matplotlib |
|
|
|
|
|
RUN mkdir -p /.fonts /.config /app/models && \ |
|
chmod -R 777 /.fonts /.config /app/models |
|
|
|
RUN mkdir -p /app/flagged && chmod 777 /app/flagged |
|
|
|
|
|
|
|
RUN useradd -m appuser |
|
USER appuser |
|
|
|
|
|
CMD ["python", "app.py"] |