|
|
|
FROM python:3.9-slim |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
ffmpeg \ |
|
git \ |
|
wget \ |
|
imagemagick \ |
|
libmagick++-dev \ |
|
fonts-liberation \ |
|
fonts-open-sans \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN sed -i 's/rights="none" pattern="PDF"/rights="read|write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml || true |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY requirements.txt . |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY . . |
|
|
|
|
|
RUN mkdir -p uploads outputs templates temp \ |
|
&& mkdir -p /app/.cache/huggingface /app/.config/matplotlib \ |
|
&& chmod -R 777 /app |
|
|
|
|
|
RUN mv index.html templates/ 2>/dev/null || true |
|
RUN mv processing.html templates/ 2>/dev/null || true |
|
RUN mv results.html templates/ 2>/dev/null || true |
|
RUN mv vsl.html templates/ 2>/dev/null || true |
|
|
|
|
|
|
|
|
|
|
|
ENV MPLCONFIGDIR=/app/.config/matplotlib |
|
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface |
|
ENV HF_HOME=/app/.cache/huggingface |
|
ENV XDG_CACHE_HOME=/app/.cache |
|
ENV IMAGEMAGICK_BINARY=/usr/bin/convert |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["python", "app.py"] |
|
|