Spaces:
Sleeping
Sleeping
Download Dockerfile from Pujan-Dev/test-space: direct link, hf CLI and curl.
- Browser
- Download file 786 Bytes
-
https://huggingface.co/spaces/Pujan-Dev/test-space/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Pujan-Dev/test-space/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Pujan-Dev/test-space/resolve/main/Dockerfile
786 Bytes
| # Use the latest slim Python 3.11 image | |
| FROM python:3.11-slim | |
| # Set environment variables | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| git \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user for safety | |
| RUN useradd -ms /bin/bash user | |
| USER user | |
| WORKDIR $HOME/app | |
| # Copy app source code | |
| COPY --chown=user . . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir --upgrade pip \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| # Expose port | |
| EXPOSE 7860 | |
| # Start the FastAPI app using uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |