radames commited on
Commit
c393e95
·
1 Parent(s): c0582b8

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 ./requirements.txt /code/requirements.txt
6
+
7
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
+
9
+ # Set up a new user named "user" with user ID 1000
10
+ RUN useradd -m -u 1000 user
11
+ # Switch to the "user" user
12
+ USER user
13
+
14
+ # download falcon-40b
15
+ RUN transformers-cli download "tiiuae/falcon-40b"
16
+
17
+ # Set home to the user's home directory
18
+ ENV HOME=/home/user \
19
+ PATH=/home/user/.local/bin:$PATH \
20
+ PYTHONPATH=$HOME/app \
21
+ PYTHONUNBUFFERED=1 \
22
+ GRADIO_ALLOW_FLAGGING=never \
23
+ GRADIO_NUM_PORTS=1 \
24
+ GRADIO_SERVER_NAME=0.0.0.0 \
25
+ GRADIO_THEME=huggingface \
26
+ SYSTEM=spaces
27
+
28
+ # Set the working directory to the user's home directory
29
+ WORKDIR $HOME/app
30
+
31
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
32
+ COPY --chown=user . $HOME/app