Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +17 -8
Dockerfile
CHANGED
@@ -1,4 +1,9 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
ENV DEBIAN_FRONTEND=noninteractive
|
4 |
|
@@ -19,16 +24,20 @@ RUN useradd -m -u 1000 user
|
|
19 |
# Switch to the "user" user
|
20 |
USER user
|
21 |
|
|
|
22 |
ENV HOME=/home/user \
|
23 |
-
|
|
|
|
|
|
|
24 |
PYTHONPATH=$HOME/app \
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
GRADIO_SHARE=False \
|
31 |
-
|
32 |
|
33 |
# Set the environment variable to specify the GPU device
|
34 |
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
|
|
1 |
+
# Use an official PyTorch image with CUDA support as the base image
|
2 |
+
FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
|
3 |
+
|
4 |
+
# Add NVIDIA CUDA GPG key
|
5 |
+
# Add NVIDIA CUDA GPG key using a different key server
|
6 |
+
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key A4B469963BF863CC
|
7 |
|
8 |
ENV DEBIAN_FRONTEND=noninteractive
|
9 |
|
|
|
24 |
# Switch to the "user" user
|
25 |
USER user
|
26 |
|
27 |
+
# Set environment variables
|
28 |
ENV HOME=/home/user \
|
29 |
+
CUDA_HOME=/usr/local/cuda \
|
30 |
+
PATH=/home/user/.local/bin:$PATH \
|
31 |
+
LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH} \
|
32 |
+
LIBRARY_PATH=${CUDA_HOME}/lib64/stubs:${LIBRARY_PATH} \
|
33 |
PYTHONPATH=$HOME/app \
|
34 |
+
PYTHONUNBUFFERED=1 \
|
35 |
+
GRADIO_ALLOW_FLAGGING=never \
|
36 |
+
GRADIO_NUM_PORTS=1 \
|
37 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
38 |
+
GRADIO_THEME=huggingface \
|
39 |
GRADIO_SHARE=False \
|
40 |
+
SYSTEM=spaces
|
41 |
|
42 |
# Set the environment variable to specify the GPU device
|
43 |
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|