behaviour01/deep_learning
1
1# Use official lightweight Python image2FROM python:3.10-slim3 4# Set a working directory with write permissions5WORKDIR /app6 7# Install system dependencies8RUN apt-get update && \9 apt-get install -y --no-install-recommends gcc libgl1 libglib2.0-0 && \10 rm -rf /var/lib/apt/lists/*11 12# Create a non-root user and switch to it13RUN adduser --disabled-password --gecos '' appuser14USER appuser15ENV HOME=/home/appuser16ENV PATH="${HOME}/.local/bin:${PATH}"17 18# Copy the app script (assumes app.py is in the same folder)19COPY --chown=appuser:appuser app.py .20 21# Install Python packages in user space22RUN python -m pip install --no-cache-dir python-telegram-bot==20.0 requests fastapi uvicorn23 24# Expose Flask port required by Hugging Face Spaces25EXPOSE 786026 27# Run the app as non-root user28CMD ["python", "app.py"]