|
|
|
FROM python:3.10.13 |
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 |
|
ENV PYTHONUNBUFFERED=1 |
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
ffmpeg \ |
|
libsndfile1 \ |
|
git \ |
|
wget \ |
|
libegl1 \ |
|
libgl1 \ |
|
libgl1-mesa-glx \ |
|
libopengl0 \ |
|
libxcb-cursor0 \ |
|
libxcb-shape0 \ |
|
libxcb-randr0 \ |
|
libxcb-render0 \ |
|
libxcb-render-util0 \ |
|
libxcb-image0 \ |
|
libxcb-keysyms1 \ |
|
libxcb-glx0 \ |
|
libxkbcommon0 \ |
|
libxkbcommon-x11-0 \ |
|
libx11-xcb1 \ |
|
libxrender1 \ |
|
libxfixes3 \ |
|
libxdamage1 \ |
|
libxext6 \ |
|
libsm6 \ |
|
libx11-6 \ |
|
libxft2 \ |
|
libxinerama1 \ |
|
libxrandr2 \ |
|
libxcomposite1 \ |
|
libxcursor1 \ |
|
libxi6 \ |
|
libfontconfig1 \ |
|
libfreetype6 \ |
|
libssl3 \ |
|
libxml2 \ |
|
libxslt1.1 \ |
|
libsqlite3-0 \ |
|
zlib1g \ |
|
libopenjp2-7 \ |
|
libjpeg62-turbo \ |
|
libpng16-16 \ |
|
libtiff-dev \ |
|
libwebp7 \ |
|
poppler-utils \ |
|
libxml2-dev \ |
|
libxslt1-dev \ |
|
libgtk-3-0 \ |
|
libglib2.0-0 \ |
|
libglib2.0-data \ |
|
libice6 \ |
|
&& apt-get clean \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin |
|
|
|
|
|
ENV PATH="/root/calibre:${PATH}" |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN mkdir -p /app/Working_files/Book /app/Working_files/temp_ebook /app/Working_files/temp |
|
|
|
|
|
COPY requirements.txt . |
|
|
|
|
|
RUN pip install --upgrade pip |
|
RUN pip install --no-cache-dir --verbose -r requirements.txt |
|
|
|
|
|
ENV TRANSFORMERS_CACHE=/app/cache |
|
ENV HF_HOME=/app/cache |
|
RUN mkdir -p /app/cache && chmod -R 777 /app/cache |
|
|
|
|
|
ENV MPLCONFIGDIR=/app/cache/matplotlib |
|
RUN mkdir -p $MPLCONFIGDIR && chmod -R 777 $MPLCONFIGDIR |
|
|
|
|
|
RUN python -m nltk.downloader punkt |
|
|
|
|
|
COPY app.py . |
|
|
|
|
|
ENTRYPOINT ["python", "app.py"] |
|
CMD [] |
|
|