Spaces:
Sleeping
Sleeping
| # PhishingInsight - Enterprise Security Module | |
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Environment configuration | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| curl \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Dependency Layer | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Application Layer | |
| COPY . . | |
| # Ensure directory structure | |
| RUN mkdir -p models cache logs | |
| # Pre-computation: Train model if missing | |
| RUN python src/ml/train_model.py | |
| # Service Ports (UI: 7860, API: 8000) | |
| EXPOSE 7860 8000 | |
| # Health Check | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ | |
| CMD curl -f http://localhost:8000/health || exit 1 | |
| # Launch System | |
| CMD ["python", "main.py"] | |