Spaces:
No application file
No application file
| # Production Dockerfile for AI Firewall | |
| # Designed for Hugging Face Spaces & Cloud Providers | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install | |
| COPY ai_firewall/requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Install optional ML dependencies and Gradio for UI | |
| RUN pip install --no-cache-dir sentence-transformers torch scikit-learn numpy gradio | |
| # Copy the project | |
| COPY . . | |
| # Set environment variables for production | |
| ENV FIREWALL_BLOCK_THRESHOLD=0.70 | |
| ENV FIREWALL_FLAG_THRESHOLD=0.40 | |
| ENV FIREWALL_USE_EMBEDDINGS=true | |
| ENV PYTHONUNBUFFERED=1 | |
| # Expose the API port | |
| EXPOSE 8000 | |
| # Start the Gradio App (which also houses the logic) | |
| CMD ["python", "app.py"] | |