Spaces:
Runtime error
Runtime error
Download Dockerfile from behaviour01/deep_learning: direct link, hf CLI and curl.
- Browser
- Download file 810 Bytes
-
https://huggingface.co/spaces/behaviour01/deep_learning/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/behaviour01/deep_learning/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/behaviour01/deep_learning/resolve/main/Dockerfile
810 Bytes
| # Use official lightweight Python image | |
| FROM python:3.10-slim | |
| # Set a working directory with write permissions | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends gcc libgl1 libglib2.0-0 && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user and switch to it | |
| RUN adduser --disabled-password --gecos '' appuser | |
| USER appuser | |
| ENV HOME=/home/appuser | |
| ENV PATH="${HOME}/.local/bin:${PATH}" | |
| # Copy the app script (assumes app.py is in the same folder) | |
| COPY --chown=appuser:appuser app.py . | |
| # Install Python packages in user space | |
| RUN python -m pip install --no-cache-dir python-telegram-bot==20.0 requests fastapi uvicorn | |
| # Expose Flask port required by Hugging Face Spaces | |
| EXPOSE 7860 | |
| # Run the app as non-root user | |
| CMD ["python", "app.py"] |