FROM python:3.10 # Switch to root to install system packages USER root # Install dependencies, Google Chrome, and FFmpeg RUN apt-get update && apt-get install -y \ wget \ gnupg \ ffmpeg \ unzip \ curl \ && curl -fSsL https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor | tee /usr/share/keyrings/google-chrome.gpg > /dev/null \ && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \ && apt-get update \ && apt-get install -y google-chrome-stable \ && rm -rf /var/lib/apt/lists/* # Hugging Face requires a specific user setup RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app # Copy all your bot files COPY --chown=user . $HOME/app/ # Install Python requirements RUN pip install --no-cache-dir -r requirements.txt # Permissions for the startup script RUN chmod +x run.sh # Run the startup script CMD ["bash", "run.sh"]