kiurtis commited on
Commit
94939e1
·
1 Parent(s): 70f4ec6

new dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -9
Dockerfile CHANGED
@@ -1,18 +1,26 @@
1
- # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
-
4
- FROM python:3.11
 
 
 
 
 
 
 
5
 
6
  RUN useradd -m -u 1000 user
7
- RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
8
-
9
  USER user
10
  ENV PATH="/home/user/.local/bin:$PATH"
 
11
 
12
  WORKDIR /app
13
 
14
  COPY --chown=user ./requirements.txt requirements.txt
15
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
16
- RUN ONNX_MODE=cuda
 
17
  COPY --chown=user . /app
18
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # Use an NVIDIA CUDA runtime image that has cuDNN9 installed.
2
+ # (Adjust the tag if needed; here we assume this tag is available.)
3
+ FROM nvidia/cuda:12.4.0-cudnn9-runtime-ubuntu20.04
4
+ RUN apt-get update && apt-get install -y \
5
+ python3.11 \
6
+ python3.11-venv \
7
+ python3.11-dev \
8
+ ffmpeg \
9
+ libsm6 \
10
+ libxext6 \
11
+ && rm -rf /var/lib/apt/lists/*
12
 
13
  RUN useradd -m -u 1000 user
 
 
14
  USER user
15
  ENV PATH="/home/user/.local/bin:$PATH"
16
+ ENV ONNX_MODE=cuda
17
 
18
  WORKDIR /app
19
 
20
  COPY --chown=user ./requirements.txt requirements.txt
21
+ RUN python3.11 -m pip install --no-cache-dir --upgrade pip && \
22
+ python3.11 -m pip install --no-cache-dir -r requirements.txt
23
+
24
  COPY --chown=user . /app
25
+
26
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]