FROM python:3.11 RUN apt-get update \ && apt-get -y install tesseract-ocr RUN : \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y # Install dependencies RUN apt-get update && apt-get install -y git wget # Create and use a non-root user RUN useradd -m -u 1000 user # Create the directory for the repository and give the non-root user access to it RUN mkdir /Responsible-AI-Privacy && chown -R user:user /Responsible-AI-Privacy USER user # Update PATH to include the user's local bin directory ENV PATH="/home/user/.local/bin:$PATH" # Install Hugging Face dependencies and other packages RUN pip install --user huggingface_hub transformers git+https://github.com/huggingface/transformers.git RUN echo "added model" > /dev/null # Clone the repository RUN git clone https://huggingface.co/InfosysResponsibleAiToolKit/Responsible-AI-Privacy /Responsible-AI-Privacy COPY --chown=user . . RUN ls -la COPY --chown=user . /Responsible-AI-Privacy/responsible-ai-privacy/lib # Check if the file exists in the expected location RUN if [ ! -f "/Responsible-AI-Privacy/responsible-ai-privacy/src/privacy/util/model/craft_mlt_25k.pth" ]; then \ echo "File does not exist!"; exit 1; \ else echo "File exists!"; fi WORKDIR /Responsible-AI-Privacy/responsible-ai-privacy RUN ls -la RUN pip install --no-cache-dir /Responsible-AI-Privacy/responsible-ai-privacy/lib/en_core_web_lg-3.7.1-py3-none-any.whl RUN pip install -r requirements/requirement.txt RUN pip install datasets==2.15.0 RUN pip install numpy==1.26.2 RUN pip install torch==2.4.1 RUN pip install torchvision==0.15.1 RUN pip show torch RUN pip show torchvision WORKDIR /Responsible-AI-Privacy/responsible-ai-privacy/src EXPOSE 30002 CMD ["sh","-c","python3 privacy_main.py"]