| FROM docker.io/library/python:3.10@sha256:7118d485696a1eb1105ae30e3f55e5685117a9bc0c3ffbe3830a268911e0837d
|
|
|
|
|
| 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
|
|
|
|
|
| COPY requirements.txt /tmp/requirements.txt
|
|
|
|
|
| RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
|
|
|
|
| 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 . /home/user/app
|
|
|
|
|
| USER user
|
|
|
|
|
| CMD ["python", "app.py"] |