fffiloni commited on
Commit
fa29bc8
1 Parent(s): 1cb6bad

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -0
Dockerfile ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/fffiloni/style-aligned.git $HOME/app
27
+
28
+ # Install dependencies
29
+ RUN pip install --no-cache-dir -r requirements.txt gradio
30
+
31
+ COPY app.py .
32
+
33
+ RUN find $HOME/app
34
+
35
+ # Set the environment variable to specify the GPU device
36
+ ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
37
+ ENV CUDA_VISIBLE_DEVICES=0
38
+
39
+ # Run your app.py script
40
+ CMD ["python", "app.py"]
41
+
42
+