KevinX-Penn28 commited on
Commit
4a31e34
·
verified ·
1 Parent(s): 77e287a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -13
Dockerfile CHANGED
@@ -1,27 +1,35 @@
1
  FROM nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04
2
  RUN useradd -m -u 1001 user
3
- WORKDIR /app
4
- ENV PYTHONUNBUFFERED=1 \
5
- PIP_NO_CACHE_DIR=1
6
 
7
- # System dependencies required for compiling GroundingDINO ops and running FFmpeg
8
  RUN apt-get update && \
9
  apt-get install -y --no-install-recommends \
 
 
10
  git \
11
  build-essential \
12
  ninja-build \
13
- ffmpeg && \
 
 
14
  rm -rf /var/lib/apt/lists/*
15
 
16
- # Install Python dependencies first to leverage Docker layer caching
17
- COPY --chown=user ./requirements.txt requirements.txt
18
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
19
- RUN pip install --upgrade pip && \
20
- pip install -r requirements.txt
 
 
 
 
 
 
 
21
 
22
- # Copy the rest of the application
23
- COPY . .
24
 
25
  EXPOSE 7860
26
 
27
- CMD ["python", "app.py"]
 
1
  FROM nvidia/cuda:13.0.2-cudnn-devel-ubuntu24.04
2
  RUN useradd -m -u 1001 user
 
 
 
3
 
4
+ # System deps
5
  RUN apt-get update && \
6
  apt-get install -y --no-install-recommends \
7
+ python3 \
8
+ python3-pip \
9
  git \
10
  build-essential \
11
  ninja-build \
12
+ ffmpeg \
13
+ libgl1 \
14
+ libglib2.0-0 && \
15
  rm -rf /var/lib/apt/lists/*
16
 
17
+ WORKDIR /app
18
+
19
+ ENV PYTHONUNBUFFERED=1 \
20
+ PIP_NO_CACHE_DIR=1
21
+
22
+ # Copy & install Python deps
23
+ COPY --chown=user requirements.txt requirements.txt
24
+ RUN pip3 install --upgrade pip && \
25
+ pip3 install --no-cache-dir -r requirements.txt
26
+
27
+ # Copy rest of app source
28
+ COPY --chown=user . .
29
 
30
+ # Switch to non-root
31
+ USER user
32
 
33
  EXPOSE 7860
34
 
35
+ CMD ["python3", "app.py"]