aknouce94 commited on
Commit
3cbb053
·
verified ·
1 Parent(s): f33d9d8

# HTS Investigation Suite - Dockerfile API Backend

Browse files

# HIGH TECH SECURITY - Production Container

FROM python:3.11-slim-bullseye

# Métadonnées
LABEL maintainer="HIGH TECH SECURITY <contact@hts-investigation.com>"
LABEL version="2.1.0"
LABEL description="HTS Investigation Suite API Backend"
LABEL company="HIGH TECH SECURITY"
LABEL address="203-205 The Vale, London W3 7QS, United Kingdom"
LABEL company_number="7849187"
LABEL policy_number="550.232.804"

# Variables d'environnement
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
DEBIAN_FRONTEND=noninteractive \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1

# Création utilisateur non-root
RUN groupadd -r hts && useradd -r -g hts hts

# Installation dépendances système
RUN apt-get update && apt-get install -y \
gcc \
g++ \
libc6-dev \
libpq-dev \
curl \
wget \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*

# Création répertoires
WORKDIR /app
RUN mkdir -p /app/logs /app/uploads /app/models /app/data && \
chown -R hts:hts /app

# Installation dépendances Python
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Téléchargement modèles NLTK
RUN python -c "import nltk; nltk.download('punkt'); nltk.download('words')"

# Téléchargement modèles Sentence Transformers
RUN python -c "
from sentence_transformers import SentenceTransformer
print('Téléchargement modèles DarkBERT...')
SentenceTransformer('sentence-transformers/multi-qa-distilbert-cos-v1')
SentenceTransformer('sentence-transformers/paraphrase-albert-small-v2')
SentenceTransformer('sentence-transformers/all-distilroberta-v1')
print('Modèles téléchargés avec succès')
"

# Copie du code
COPY --chown=hts:hts . .

# Configuration permissions
RUN chmod +x /app/*.py && \
chown -R hts:hts /app

# Script de démarrage
COPY start.sh /start.sh
RUN chmod +x /start.sh

# Utilisateur non-root
USER hts

# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1

# Exposition du port
EXPOSE 8000

# Point d'entrée
ENTRYPOINT ["/start.sh"]
CMD ["gunicorn", "main:app", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8000"]

Files changed (1) hide show
  1. index.html +6 -6
index.html CHANGED
@@ -3,8 +3,8 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>CyberSleuth Prodigy | Security Dashboard</title>
7
- <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  <script src="https://unpkg.com/feather-icons"></script>
10
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
@@ -90,7 +90,7 @@
90
  </a>
91
  <a href="#" class="flex items-center space-x-2 px-4 py-3 border-b-2 border-transparent hover:border-gray-600 transition-colors">
92
  <i data-feather="brain" class="w-4 h-4"></i>
93
- <span>Analyse DB IA</span>
94
  </a>
95
  <a href="#" class="flex items-center space-x-2 px-4 py-3 border-b-2 border-transparent hover:border-gray-600 transition-colors">
96
  <i data-feather="search" class="w-4 h-4"></i>
@@ -232,10 +232,10 @@
232
  <h3 class="text-lg font-semibold text-gray-900 mb-4">Start New Analysis</h3>
233
  <p class="text-sm text-gray-600 mb-4">Initiate DarkBERT analysis with documents or text input</p>
234
  <button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg flex items-center justify-center space-x-2">
235
- <i data-feather="cpu" class="w-4 h-4"></i>
236
- <span>Launch DarkBERT</span>
237
  </button>
238
- </div>
239
 
240
  <div class="bg-white rounded-xl shadow-lg p-6 border border-gray-200">
241
  <h3 class="text-lg font-semibold text-gray-900 mb-4">Recent Investigations</h3>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>HIGH TECH SECURITY | HTS Investigation Suite</title>
7
+ <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  <script src="https://unpkg.com/feather-icons"></script>
10
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
 
90
  </a>
91
  <a href="#" class="flex items-center space-x-2 px-4 py-3 border-b-2 border-transparent hover:border-gray-600 transition-colors">
92
  <i data-feather="brain" class="w-4 h-4"></i>
93
+ <span>DarkBERT Analysis</span>
94
  </a>
95
  <a href="#" class="flex items-center space-x-2 px-4 py-3 border-b-2 border-transparent hover:border-gray-600 transition-colors">
96
  <i data-feather="search" class="w-4 h-4"></i>
 
232
  <h3 class="text-lg font-semibold text-gray-900 mb-4">Start New Analysis</h3>
233
  <p class="text-sm text-gray-600 mb-4">Initiate DarkBERT analysis with documents or text input</p>
234
  <button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg flex items-center justify-center space-x-2">
235
+ <i data-feather="brain" class="w-4 h-4"></i>
236
+ <span>Launch DarkBERT Analysis</span>
237
  </button>
238
+ </div>
239
 
240
  <div class="bg-white rounded-xl shadow-lg p-6 border border-gray-200">
241
  <h3 class="text-lg font-semibold text-gray-900 mb-4">Recent Investigations</h3>