FROM docker.io/library/python:3.10@sha256:7118d485696a1eb1105ae30e3f55e5685117a9bc0c3ffbe3830a268911e0837d # Install system dependencies RUN apt-get update && apt-get install -y fakeroot && \ mv /usr/bin/apt-get /usr/bin/.apt-get && \ echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && \ chmod +x /usr/bin/apt-get && \ rm -rf /var/lib/apt/lists/* && \ useradd -m -u 1000 user COPY --chown=1000:1000 --from=root / / RUN pip install --no-cache-dir pip -U && \ pip install --no-cache-dir \ datasets \ "huggingface-hub>=0.19" \ "hf_xet>=1.0.0,<2.0.0" \ "hf-transfer>=0.1.4" \ "protobuf<4" \ "click<8.1" \ "pydantic~=1.0" WORKDIR /home/user/app RUN apt-get update && apt-get install -y \ git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx && \ rm -rf /var/lib/apt/lists/* && \ git lfs install RUN apt-get update && \ apt-get install -y curl && \ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs && \ rm -rf /var/lib/apt/lists/* && apt-get clean # Assuming your requirements.txt is in the root of your repository COPY requirements.txt /tmp/requirements.txt # Install Python dependencies from requirements.txt RUN pip install --no-cache-dir -r /tmp/requirements.txt # Download the spaCy model and set the SPACY_DATA environment variable RUN python -m spacy download en_core_web_sm RUN python -c "import spacy; print(spacy.util.get_data_path())" ENV SPACY_DATA=$(python -c "import spacy; print(spacy.util.get_data_path())") # Copy your application code COPY . /home/user/app # Set the user context USER user # Define the command to run your application (adjust if your main file is named differently) CMD ["python", "app.py"]