HugoVoxx commited on
Commit
45688dc
·
verified ·
1 Parent(s): 11695a5

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+
3
+ WORKDIR /code
4
+
5
+ COPY ./pre-requirements.txt /code/pre-requirements.txt
6
+ COPY ./requirements.txt /code/requirements.txt
7
+
8
+ RUN pip install --no-cache-dir --require-hashes --no-deps -r /code/pre-requirements.txt
9
+ RUN pip install --no-cache-dir --no-deps -r /code/requirements.txt
10
+
11
+ # Set up a new user named "user" with user ID 1000
12
+ RUN useradd -m -u 1000 user
13
+ # Switch to the "user" user
14
+ USER user
15
+ # Set home to the user's home directory
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
+ SYSTEM=spaces
25
+
26
+ # Set the working directory to the user's home directory
27
+ WORKDIR $HOME/app
28
+
29
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
30
+ COPY --chown=user . $HOME/app
31
+
32
+ CMD ["python", "app.py"]