Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +43 -0
Dockerfile
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official PyTorch image with CUDA support as the base image
|
| 2 |
+
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
|
| 3 |
+
|
| 4 |
+
# Install Git and system libraries required for OpenGL without interactive prompts
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
# Install Git and OpenGL libraries, and libglib2.0
|
| 8 |
+
RUN apt-get update && apt-get install -y git libgl1-mesa-glx libglib2.0-0
|
| 9 |
+
|
| 10 |
+
# Set up a new user named "user" with user ID 1000
|
| 11 |
+
RUN useradd -m -u 1000 user
|
| 12 |
+
|
| 13 |
+
# Switch to the "user" user
|
| 14 |
+
USER user
|
| 15 |
+
|
| 16 |
+
ENV HOME=/home/user \
|
| 17 |
+
PATH=/home/user/.local/bin:$PATH \
|
| 18 |
+
PYTHONPATH=$HOME/app \
|
| 19 |
+
PYTHONUNBUFFERED=1 \
|
| 20 |
+
GRADIO_ALLOW_FLAGGING=never \
|
| 21 |
+
GRADIO_NUM_PORTS=1 \
|
| 22 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
| 23 |
+
GRADIO_THEME=huggingface \
|
| 24 |
+
GRADIO_SHARE=False \
|
| 25 |
+
SYSTEM=spaces
|
| 26 |
+
|
| 27 |
+
# Set the working directory to the user's home directory
|
| 28 |
+
WORKDIR $HOME/app
|
| 29 |
+
|
| 30 |
+
# Clone your repository or add your code to the container
|
| 31 |
+
RUN git clone -b main https://github.com/fffiloni/Hotshot-XL $HOME/app
|
| 32 |
+
|
| 33 |
+
# Install dependencies
|
| 34 |
+
RUN pip install --no-cache-dir -r requirements.txt gradio accelerate
|
| 35 |
+
|
| 36 |
+
RUN find $HOME/app
|
| 37 |
+
|
| 38 |
+
# Set the environment variable to specify the GPU device
|
| 39 |
+
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
| 40 |
+
ENV CUDA_VISIBLE_DEVICES=0
|
| 41 |
+
|
| 42 |
+
# Run your app.py script
|
| 43 |
+
CMD ["python", "app.py"]
|