31 lines
937 B
Docker
31 lines
937 B
Docker
# Utiliser l'image officielle Presidio Analyzer
|
|
FROM mcr.microsoft.com/presidio-analyzer:latest
|
|
|
|
# Rester en root pour éviter les problèmes d'utilisateur
|
|
USER root
|
|
|
|
# Installer les dépendances système
|
|
RUN apt-get update && apt-get install -y \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Installer le modèle spaCy français
|
|
RUN pip install --no-cache-dir \
|
|
https://github.com/explosion/spacy-models/releases/download/fr_core_news_sm-3.7.0/fr_core_news_sm-3.7.0-py3-none-any.whl
|
|
|
|
# Copier la configuration
|
|
COPY ./presidio_config/ /app/presidio_config/
|
|
COPY ./presidio_config/conf/default.yaml /usr/bin/presidio-analyzer/presidio_analyzer/conf/default.yaml
|
|
|
|
# Installer les dépendances supplémentaires
|
|
COPY requirements.txt /app/
|
|
RUN pip install --no-cache-dir -r /app/requirements.txt
|
|
|
|
# Définir le répertoire de travail
|
|
WORKDIR /app
|
|
|
|
# Exposer le port
|
|
EXPOSE 5001
|
|
|
|
# Utiliser la commande par défaut de l'image de base
|