| |
| |
|
|
| FROM python:3.11-slim |
|
|
| |
| WORKDIR /app |
|
|
| |
| |
| |
| |
| |
| RUN apt-get update && apt-get install -y \ |
| ffmpeg \ |
| libcairo2-dev \ |
| libpango1.0-dev \ |
| pkg-config \ |
| texlive \ |
| texlive-latex-extra \ |
| texlive-fonts-extra \ |
| texlive-latex-recommended \ |
| texlive-science \ |
| tipa \ |
| libpq-dev \ |
| gcc \ |
| g++ \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN useradd -m -u 1000 user |
|
|
| |
| USER user |
|
|
| |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH \ |
| PYTHONUNBUFFERED=1 \ |
| PYTHONIOENCODING=utf-8 |
|
|
| |
| WORKDIR $HOME/app |
|
|
| |
| COPY --chown=user:user requirements.txt . |
|
|
| |
| RUN pip install --no-cache-dir --user -r requirements.txt |
|
|
| |
| COPY --chown=user:user config.py . |
| COPY --chown=user:user models.py . |
| COPY --chown=user:user validators.py . |
| COPY --chown=user:user renderer.py . |
| COPY --chown=user:user converter.py . |
| COPY --chown=user:user cleanup.py . |
| COPY --chown=user:user mcp_integration.py . |
| COPY --chown=user:user app.py . |
|
|
| |
| COPY --chown=user:user static/ ./static/ |
|
|
| |
| RUN mkdir -p /tmp/manim_renders |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
| CMD python -c "import httpx; httpx.get('http://localhost:7860/health', timeout=5)" |
|
|
| |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |
|
|