bgremover / Dockerfile
Diggz10's picture
Create Dockerfile
b2b59a6 verified
# Base image (keep your digest if you prefer)
FROM docker.io/library/python:3.10@sha256:4585309097d523698d382a2de388340896e021319b327e2d9c028f3b4c316138
# --- keep your apt-get fakeroot shim & user ---
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
# (retain your layer—assuming you had a "root" stage; otherwise remove this)
COPY --chown=1000:1000 --from=root / /
WORKDIR /home/user/app
# System deps (added build-essential, python3-dev, ninja-build for deepspeed)
RUN apt-get update && apt-get install -y \
git \
git-lfs \
ffmpeg \
libsm6 \
libxext6 \
libgl1 \
cmake \
rsync \
build-essential \
python3-dev \
ninja-build \
&& rm -rf /var/lib/apt/lists/* \
&& git lfs install
# Python tooling & common libs
# NOTE: removed the old "pydantic~=1.0" pin which conflicts with Gradio 4.x
# left protobuf<4 as you had it.
RUN pip install --no-cache-dir -U pip && \
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"
# Node.js (unchanged)
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
# Install app python deps from requirements (BuildKit mount)
# Keep your existing pattern; this layer now resolves cleanly.
RUN --mount=target=/tmp/requirements.txt,source=requirements.txt \
pip install --no-cache-dir -r /tmp/requirements.txt