ANDHEKA/Stringtest
0
1FROM python:3.10-slim2 3# Install fakeroot and patch apt-get4RUN apt-get update && apt-get install -y fakeroot && \5 mv /usr/bin/apt-get /usr/bin/.apt-get && \6 echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get "$@"' > /usr/bin/apt-get && \7 chmod +x /usr/bin/apt-get && \8 rm -rf /var/lib/apt/lists/* && \9 useradd -m -u 1000 user10 11# Optional packages.txt install (just add packages.txt to your repo if needed)12COPY packages.txt /tmp/packages.txt13RUN apt-get update && \14 xargs -r -a /tmp/packages.txt apt-get install -y && \15 apt-get install -y curl && \16 curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \17 apt-get install -y nodejs && \18 rm -rf /var/lib/apt/lists/* && apt-get clean19 20# Install system dependencies21RUN apt-get update && apt-get install -y \22 git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx && \23 rm -rf /var/lib/apt/lists/* && \24 git lfs install25 26# Set working directory27WORKDIR /home/user/app28 29# Install base Python deps30RUN pip install --no-cache-dir pip -U && \31 pip install --no-cache-dir \32 datasets \33 "huggingface-hub>=0.19" \34 "hf_xet>=1.0.0,<2.0.0" \35 "hf-transfer>=0.1.4" \36 "protobuf<4" \37 "click<8.1" \38 "pydantic~=1.0"39 40# Copy Python requirements and install41COPY requirements.txt /tmp/requirements.txt42RUN pip install --no-cache-dir -r /tmp/requirements.txt43 44# Optional: install gradio + uvicorn if you use them45RUN pip install --no-cache-dir gradio[oauth,mcp]==5.34.0 uvicorn spaces46 47# Copy the app code48COPY --link --chown=1000 ./ /home/user/app49 50 51# Expose Flask or Gradio port52EXPOSE 786053 54# Run your app55CMD ["python", "app.py"]56 