| FROM python:3.10-slim |
|
|
| |
| RUN apt-get update && apt-get install -y fakeroot && \ |
| mv /usr/bin/apt-get /usr/bin/.apt-get && \ |
| echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get "$@"' > /usr/bin/apt-get && \ |
| chmod +x /usr/bin/apt-get && \ |
| rm -rf /var/lib/apt/lists/* && \ |
| useradd -m -u 1000 user |
|
|
| |
| RUN echo "deb http://deb.debian.org/debian bookworm main non-free" > /etc/apt/sources.list && \ |
| echo "deb http://deb.debian.org/debian-security bookworm-security main non-free" >> /etc/apt/sources.list && \ |
| apt-get update && \ |
| apt-get install -y --no-install-recommends \ |
| apt-transport-https \ |
| ca-certificates \ |
| debian-archive-keyring \ |
| locales \ |
| libarchive-tools \ |
| liblzma-dev \ |
| && apt-get clean \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx curl && \ |
| curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ |
| apt-get install -y nodejs && \ |
| rm -rf /var/lib/apt/lists/* && \ |
| git lfs install |
|
|
| |
| RUN --mount=type=secret,id=mm,mode=0444,required=true \ |
| git clone $(cat /run/secrets/mm) /home/user/app && \ |
| chown -R user:user /home/user/app |
|
|
| |
| WORKDIR /home/user/app |
|
|
| |
| RUN apt-get update && \ |
| if [ -f packages.txt ]; then xargs -r -a packages.txt apt-get install -y; fi && \ |
| rm -rf /var/lib/apt/lists/* && apt-get clean |
|
|
| |
| RUN if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; else echo "requirements.txt not found, skipping"; fi |
|
|
| |
| RUN pip install --no-cache-dir \ |
| pyrogram==2.0.106 |
| |
| RUN pip install --no-cache-dir gradio[oauth,mcp]==5.34.0 uvicorn spaces flask pymongo python-telegram-bot |
| EXPOSE 7860 |
| CMD python3 --version && python3 app.py |