Spaces:
Sleeping
Sleeping
new dockerfile
Browse files- Dockerfile +17 -9
Dockerfile
CHANGED
@@ -1,18 +1,26 @@
|
|
1 |
-
#
|
2 |
-
#
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
16 |
-
|
|
|
17 |
COPY --chown=user . /app
|
18 |
-
|
|
|
|
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"]
|