Spaces:
Running
Running
File size: 1,183 Bytes
186c77e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# Base image
FROM docker.io/library/python:3.10@sha256:fd0fa50d997eb56ce560c6e5ca6a1f5cf8fdff87572a16ac07fb1f5ca01eb608
# Update pip
RUN pip install --no-cache-dir pip==24.2
# Install basic dependencies
RUN apt-get update && apt-get install -y \
fakeroot \
git \
git-lfs \
ffmpeg \
libsm6 \
libxext6 \
cmake \
rsync \
libgl1-mesa-glx \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/* && apt-get clean
# Create a non-root user
RUN 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 && \
useradd -m -u 1000 user
# Set working directory
WORKDIR /home/user/app
# Copy the requirements file
COPY --chown=1000:1000 requirements.txt .
# Install torch separately
RUN pip install --no-cache-dir torch
# Install the remaining packages
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY --chown=1000:1000 . .
# Set the entry point
CMD ["python", "app.py"] |