oceansweep commited on
Commit
a2f0ca8
1 Parent(s): 6fa2d2f

create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -0
Dockerfile ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
2
+
3
+ ARG DEBIAN_FRONTEND=noninteractive
4
+
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ RUN apt-get update && apt-get install --no-install-recommends -y \
8
+ build-essential \
9
+ python3.9 \
10
+ python3-pip \
11
+ git \
12
+ ffmpeg \
13
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
14
+
15
+ WORKDIR /code
16
+
17
+ COPY ./requirements.txt /code/requirements.txt
18
+
19
+ # Set up a new user named "user" with user ID 1000
20
+ RUN useradd -m -u 1000 user
21
+ # Switch to the "user" user
22
+ USER user
23
+ # Set home to the user's home directory
24
+ ENV HOME=/home/user \
25
+ PATH=/home/user/.local/bin:$PATH \
26
+ PYTHONPATH=$HOME/app \
27
+ PYTHONUNBUFFERED=1 \
28
+ GRADIO_ALLOW_FLAGGING=never \
29
+ GRADIO_NUM_PORTS=1 \
30
+ GRADIO_SERVER_NAME=0.0.0.0 \
31
+ GRADIO_THEME=huggingface \
32
+ SYSTEM=spaces
33
+
34
+ RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
35
+
36
+ # Set the working directory to the user's home directory
37
+ WORKDIR $HOME/app
38
+
39
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
40
+ COPY --chown=user . $HOME/app
41
+
42
+ CMD ["python3", "app.py"]