File size: 841 Bytes
7c918e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ba61591
 
7c918e8
 
 
 
 
 
 
 
 
 
 
 
 
ba61591
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# 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"]