Spaces:
Sleeping
Sleeping
Download Dockerfile from Swapnilbpatil/website: direct link, hf CLI and curl.
- Browser
- Download file 744 Bytes
-
https://huggingface.co/spaces/Swapnilbpatil/website/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Swapnilbpatil/website/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Swapnilbpatil/website/resolve/main/Dockerfile
744 Bytes
| # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | |
| FROM python:3.9-slim | |
| # Install dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy requirements first for better caching | |
| COPY --chown=user requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy application code | |
| COPY --chown=user . . | |
| # Create directories for uploads | |
| RUN mkdir -p static/images | |
| # Expose port | |
| EXPOSE 7860 | |
| # Command to run the application | |
| CMD ["python", "app.py"] |