Spaces:
Build error
Build error
Miroslav Purkrabek commited on
Commit ·
3275859
1
Parent(s): 1e7ea0d
update dockerfile by template
Browse files- Dockerfile +36 -53
Dockerfile
CHANGED
|
@@ -1,61 +1,44 @@
|
|
| 1 |
-
FROM nvidia/cuda:12.1.
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
RUN apt-get update && apt-get install -
|
| 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 |
-
# Upgrade pip
|
| 34 |
-
RUN python -m pip install --no-cache-dir --upgrade pip
|
| 35 |
-
|
| 36 |
-
# Set working directory
|
| 37 |
-
WORKDIR /app
|
| 38 |
-
|
| 39 |
-
# Copy the repository content
|
| 40 |
-
COPY . /app/
|
| 41 |
-
|
| 42 |
-
# Following the setup.sh script step by step
|
| 43 |
|
| 44 |
# Install torch, torchvision, OpenCV and NumPy with versions as specified
|
| 45 |
-
RUN
|
| 46 |
|
| 47 |
# Install MMLibrary
|
| 48 |
-
RUN
|
| 49 |
RUN mim install --no-cache-dir mmengine "mmcv==2.1.0" "mmdet==3.3.0" "mmpretrain==1.2.0"
|
| 50 |
-
RUN
|
| 51 |
-
|
| 52 |
-
# Install other dependencies from requirements
|
| 53 |
-
RUN pip install --no-cache-dir -r requirements_manual.txt
|
| 54 |
-
|
| 55 |
-
RUN pip install --no-cache-dir numpy==1.25.1 opencv-python==4.9.0.80
|
| 56 |
-
|
| 57 |
-
# Install the package itself in development mode
|
| 58 |
-
RUN pip install --no-cache-dir -e .
|
| 59 |
|
| 60 |
# Set the working directory to the user's home directory
|
| 61 |
WORKDIR $HOME/app
|
|
|
|
| 1 |
+
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
|
| 2 |
+
|
| 3 |
+
ARG DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
|
| 5 |
+
ENV PYTHONUNBUFFERED=1
|
| 6 |
+
|
| 7 |
+
RUN apt-get update && apt-get install --no-install-recommends -y \
|
| 8 |
+
build-essential \
|
| 9 |
+
python3.9 \
|
| 10 |
+
python3-pip \
|
| 11 |
+
git \
|
| 12 |
+
ffmpeg \
|
| 13 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
WORKDIR /code
|
| 16 |
+
|
| 17 |
+
COPY ./requirements_manual.txt /code/requirements_manual.txt
|
| 18 |
+
|
| 19 |
+
# Set up a new user named "user" with user ID 1000
|
| 20 |
+
RUN useradd -m -u 1000 user
|
| 21 |
+
# Switch to the "user" user
|
| 22 |
+
USER user
|
| 23 |
+
# Set home to the user's home directory
|
| 24 |
+
ENV HOME=/home/user \
|
| 25 |
+
PATH=/home/user/.local/bin:$PATH \
|
| 26 |
+
PYTHONPATH=$HOME/app \
|
| 27 |
+
PYTHONUNBUFFERED=1 \
|
| 28 |
+
GRADIO_ALLOW_FLAGGING=never \
|
| 29 |
+
GRADIO_NUM_PORTS=1 \
|
| 30 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
| 31 |
+
GRADIO_THEME=huggingface \
|
| 32 |
+
SYSTEM=spaces
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
# Install torch, torchvision, OpenCV and NumPy with versions as specified
|
| 35 |
+
RUN pip3 install --no-cache-dir torch==2.1.2+cu121 torchvision==0.16.2+cu121 --extra-index-url https://download.pytorch.org/whl/cu121
|
| 36 |
|
| 37 |
# Install MMLibrary
|
| 38 |
+
RUN pip3 install --no-cache-dir -U openmim
|
| 39 |
RUN mim install --no-cache-dir mmengine "mmcv==2.1.0" "mmdet==3.3.0" "mmpretrain==1.2.0"
|
| 40 |
+
RUN pip3 install --no-cache-dir numpy==1.25.1 opencv-python==4.9.0.80
|
| 41 |
+
RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
# Set the working directory to the user's home directory
|
| 44 |
WORKDIR $HOME/app
|