Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +38 -0
Dockerfile
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
|
2 |
+
|
3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
4 |
+
|
5 |
+
RUN apt-get update && apt-get install -y git libgl1-mesa-glx libglib2.0-0
|
6 |
+
|
7 |
+
RUN useradd -m -u 1000 user
|
8 |
+
|
9 |
+
USER user
|
10 |
+
|
11 |
+
ENV HOME=/home/user \
|
12 |
+
PATH=/home/user/.local/bin:$PATH \
|
13 |
+
PYTHONPATH=$HOME/app \
|
14 |
+
PYTHONUNBUFFERED=1 \
|
15 |
+
GRADIO_ALLOW_FLAGGING=never \
|
16 |
+
GRADIO_NUM_PORTS=1 \
|
17 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
18 |
+
GRADIO_THEME=huggingface \
|
19 |
+
GRADIO_SHARE=False \
|
20 |
+
SYSTEM=spaces
|
21 |
+
|
22 |
+
# Set the working directory to the user's home directory
|
23 |
+
WORKDIR $HOME/app
|
24 |
+
|
25 |
+
# Clone your repository or add your code to the container
|
26 |
+
RUN git clone https://github.com/PRIS-CV/DemoFusion#Running-with-Gradio-demo.git $HOME/app
|
27 |
+
|
28 |
+
# Install dependencies
|
29 |
+
RUN pip install --no-cache-dir gradio diffusers==0.21.4
|
30 |
+
|
31 |
+
RUN find $HOME/app
|
32 |
+
|
33 |
+
# Set the environment variable to specify the GPU device
|
34 |
+
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
35 |
+
ENV CUDA_VISIBLE_DEVICES=0
|
36 |
+
|
37 |
+
# Run your app.py script
|
38 |
+
CMD ["python", "gradio_demo.py"]
|