Download Dockerfile from mnoorchenar/loss-function-playground: direct link, hf CLI and curl.
- Browser
- Download file 689 Bytes
-
https://huggingface.co/spaces/mnoorchenar/loss-function-playground/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/mnoorchenar/loss-function-playground/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/mnoorchenar/loss-function-playground/resolve/main/Dockerfile
689 Bytes
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first for better caching | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application | |
| COPY app.py . | |
| # Create data directory | |
| RUN mkdir -p ./data | |
| # Expose port | |
| EXPOSE 7860 | |
| # Set environment variables | |
| ENV PORT=7860 | |
| ENV PYTHONUNBUFFERED=1 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ | |
| CMD python -c "import requests; requests.get('http://localhost:7860/health')" || exit 1 | |
| # Run the application | |
| CMD ["python", "app.py"] |