FROM python:3.11-slim # Install system dependencies including curl and Node.js for CLI tools RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ ca-certificates \ && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ && apt-get install -y --no-install-recommends nodejs \ && npm install -g gmgn-cli \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Create standard non-root user (UID 1000) for Hugging Face Spaces RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ PYTHONUNBUFFERED=1 \ PORT=7860 WORKDIR $HOME/app # Install Python dependencies COPY --chown=user requirements.txt . RUN pip install --no-cache-dir --user -r requirements.txt # Copy bot files COPY --chown=user . . # Expose port for Hugging Face Spaces health check EXPOSE 7860 CMD ["python", "bot.py"]