28 lines
1.0 KiB
Docker
28 lines
1.0 KiB
Docker
FROM mcr.microsoft.com/presidio-analyzer:latest
|
|
|
|
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 et installer requirements.txt
|
|
COPY requirements.txt /tmp/requirements.txt
|
|
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
|
|
|
# Définir le WORKDIR sur le répertoire parent de presidio_analyzer
|
|
WORKDIR /usr/bin
|
|
|
|
# Copier vos fichiers de configuration au bon endroit
|
|
COPY default.yaml /usr/bin/presidio-analyzer/presidio_analyzer/conf/default.yaml
|
|
COPY custom_recognizers /usr/bin/presidio-analyzer/custom_recognizers
|
|
|
|
# Ajouter le répertoire presidio-analyzer au PYTHONPATH
|
|
ENV PYTHONPATH=/usr/bin/presidio-analyzer:$PYTHONPATH
|
|
|
|
# Commande de démarrage avec le bon répertoire de travail
|
|
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:3000", "presidio_analyzer.app:app"]
|