Spaces:
Sleeping
Sleeping
Download Dockerfile from useifabdelhady/FraudDetection: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/useifabdelhady/FraudDetection/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/useifabdelhady/FraudDetection/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/useifabdelhady/FraudDetection/resolve/main/Dockerfile
1.16 kB
| # Base image | |
| FROM python:3.10-slim | |
| # Environment variables | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| MPLCONFIGDIR=/tmp/matplotlib \ | |
| HOME=/app \ | |
| PYTHONPATH=/app | |
| # Set working directory | |
| WORKDIR /app | |
| # Create a non-root user and group | |
| RUN addgroup --system appuser && adduser --system --group appuser | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgomp1 \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first to leverage Docker cache | |
| COPY requirements.txt . | |
| # Install dependencies | |
| RUN pip install --no-cache-dir --upgrade pip -r requirements.txt | |
| # Copy the rest of the application code | |
| COPY . . | |
| # Change the ownership of the app directory | |
| RUN chown -R appuser:appuser /app | |
| # Switch to the non-root user | |
| USER appuser | |
| # Expose Streamlit default port | |
| EXPOSE 7860 | |
| # FIX: Add --server.enableXsrfProtection=false to fix the 403 Forbidden error | |
| CMD ["streamlit", "run", "src/deployment/app.py", "--server.port=7860", "--server.address=0.0.0.0", "--browser.gatherUsageStats=false", "--server.enableXsrfProtection=false"] |