Spaces:
Sleeping
Sleeping
Update dockerfile
Browse files- dockerfile +5 -32
dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# Use Python 3.11 as the base image
|
| 2 |
-
FROM docker.io/library/python:3.11@sha256:
|
| 3 |
|
| 4 |
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
|
@@ -11,46 +11,19 @@ RUN apt-get update && apt-get install -y \
|
|
| 11 |
cmake \
|
| 12 |
rsync \
|
| 13 |
libgl1-mesa-glx \
|
| 14 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
-
&& git lfs install
|
| 16 |
-
|
| 17 |
-
# Upgrade pip and install Hugging Face specific dependencies
|
| 18 |
-
RUN pip install --no-cache-dir pip -U && \
|
| 19 |
-
pip install --no-cache-dir \
|
| 20 |
-
datasets \
|
| 21 |
-
"huggingface-hub>=0.19" \
|
| 22 |
-
"hf_xet>=1.0.0,<2.0.0" \
|
| 23 |
-
"hf-transfer>=0.1.4" \
|
| 24 |
-
"protobuf<4" \
|
| 25 |
-
"click<8.1" \
|
| 26 |
-
"pydantic~=1.0"
|
| 27 |
-
|
| 28 |
-
# Install fakeroot for apt-get compatibility
|
| 29 |
-
RUN apt-get update && apt-get install -y fakeroot && \
|
| 30 |
-
mv /usr/bin/apt-get /usr/bin/.apt-get && \
|
| 31 |
-
echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && \
|
| 32 |
-
chmod +x /usr/bin/apt-get && \
|
| 33 |
-
rm -rf /var/lib/apt/lists/* && \
|
| 34 |
-
useradd -m -u 1000 user
|
| 35 |
-
|
| 36 |
-
# Copy root files (if needed)
|
| 37 |
-
COPY --chown=1000:1000 --from=root / /
|
| 38 |
|
| 39 |
# Set working directory
|
| 40 |
WORKDIR /home/user/app
|
| 41 |
|
| 42 |
-
#
|
| 43 |
-
RUN
|
| 44 |
-
apt-get install -y curl && \
|
| 45 |
-
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
| 46 |
-
apt-get install -y nodejs && \
|
| 47 |
-
rm -rf /var/lib/apt/lists/* && apt-get clean
|
| 48 |
|
| 49 |
# Copy requirements.txt and install Python dependencies
|
| 50 |
COPY --chown=1000:1000 requirements.txt /tmp/requirements.txt
|
| 51 |
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 52 |
|
| 53 |
-
# Copy application code
|
| 54 |
COPY --chown=1000:1000 . .
|
| 55 |
|
| 56 |
# Command to run the app
|
|
|
|
| 1 |
# Use Python 3.11 as the base image
|
| 2 |
+
FROM docker.io/library/python:3.11@sha256:6e9f67fa63b0323fc96f8a991bd7c6382f05031c24a7e9601777c513c6cdec3f
|
| 3 |
|
| 4 |
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
|
|
|
| 11 |
cmake \
|
| 12 |
rsync \
|
| 13 |
libgl1-mesa-glx \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
# Set working directory
|
| 17 |
WORKDIR /home/user/app
|
| 18 |
|
| 19 |
+
# Create and set user
|
| 20 |
+
RUN useradd -m -u 1000 user && chown 1000:1000 /home/user/app
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# Copy requirements.txt and install Python dependencies
|
| 23 |
COPY --chown=1000:1000 requirements.txt /tmp/requirements.txt
|
| 24 |
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 25 |
|
| 26 |
+
# Copy application code
|
| 27 |
COPY --chown=1000:1000 . .
|
| 28 |
|
| 29 |
# Command to run the app
|