Create Dockerfile
Browse files- Dockerfile +53 -0
Dockerfile
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Base image (keep your digest if you prefer)
|
| 2 |
+
FROM docker.io/library/python:3.10@sha256:4585309097d523698d382a2de388340896e021319b327e2d9c028f3b4c316138
|
| 3 |
+
|
| 4 |
+
# --- keep your apt-get fakeroot shim & user ---
|
| 5 |
+
RUN apt-get update && apt-get install -y fakeroot && \
|
| 6 |
+
mv /usr/bin/apt-get /usr/bin/.apt-get && \
|
| 7 |
+
echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get "$@"' > /usr/bin/apt-get && \
|
| 8 |
+
chmod +x /usr/bin/apt-get && \
|
| 9 |
+
rm -rf /var/lib/apt/lists/* && \
|
| 10 |
+
useradd -m -u 1000 user
|
| 11 |
+
|
| 12 |
+
# (retain your layer—assuming you had a "root" stage; otherwise remove this)
|
| 13 |
+
COPY --chown=1000:1000 --from=root / /
|
| 14 |
+
|
| 15 |
+
WORKDIR /home/user/app
|
| 16 |
+
|
| 17 |
+
# System deps (added build-essential, python3-dev, ninja-build for deepspeed)
|
| 18 |
+
RUN apt-get update && apt-get install -y \
|
| 19 |
+
git \
|
| 20 |
+
git-lfs \
|
| 21 |
+
ffmpeg \
|
| 22 |
+
libsm6 \
|
| 23 |
+
libxext6 \
|
| 24 |
+
libgl1 \
|
| 25 |
+
cmake \
|
| 26 |
+
rsync \
|
| 27 |
+
build-essential \
|
| 28 |
+
python3-dev \
|
| 29 |
+
ninja-build \
|
| 30 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 31 |
+
&& git lfs install
|
| 32 |
+
|
| 33 |
+
# Python tooling & common libs
|
| 34 |
+
# NOTE: removed the old "pydantic~=1.0" pin which conflicts with Gradio 4.x
|
| 35 |
+
# left protobuf<4 as you had it.
|
| 36 |
+
RUN pip install --no-cache-dir -U pip && \
|
| 37 |
+
pip install --no-cache-dir \
|
| 38 |
+
datasets \
|
| 39 |
+
"huggingface-hub>=0.19" \
|
| 40 |
+
"hf_xet>=1.0.0,<2.0.0" \
|
| 41 |
+
"hf-transfer>=0.1.4" \
|
| 42 |
+
"protobuf<4"
|
| 43 |
+
|
| 44 |
+
# Node.js (unchanged)
|
| 45 |
+
RUN apt-get update && apt-get install -y curl && \
|
| 46 |
+
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
| 47 |
+
apt-get install -y nodejs && \
|
| 48 |
+
rm -rf /var/lib/apt/lists/* && apt-get clean
|
| 49 |
+
|
| 50 |
+
# Install app python deps from requirements (BuildKit mount)
|
| 51 |
+
# Keep your existing pattern; this layer now resolves cleanly.
|
| 52 |
+
RUN --mount=target=/tmp/requirements.txt,source=requirements.txt \
|
| 53 |
+
pip install --no-cache-dir -r /tmp/requirements.txt
|