jinnotgin commited on
Commit
f332bea
·
verified ·
1 Parent(s): e1ca7c0

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # you will also find guides on how best to write your Dockerfile
3
+
4
+ FROM python:3.9
5
+
6
+ # Set up a new user named "user" with user ID 1000
7
+ RUN useradd -m -u 1000 user
8
+
9
+ # Switch to the "user" user
10
+ USER user
11
+
12
+ # Set home to the user's home directory
13
+ ENV HOME=/home/user \
14
+ PATH=/home/user/.local/bin:$PATH
15
+
16
+ # Set the working directory to the user's home directory
17
+ WORKDIR $HOME/app
18
+
19
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
20
+ COPY --chown=user . $HOME/app
21
+
22
+ # Mount the secret and copy it to the app directory, then change its ownership to user
23
+ RUN --mount=type=secret,id=GOOGLE_APPLICATION_CREDENTIALS_DATA,mode=0444,required=true \
24
+ cp /run/secrets/GOOGLE_APPLICATION_CREDENTIALS_DATA ./gcp_credentials.json
25
+
26
+ # Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
27
+ RUN pip install --no-cache-dir --upgrade pip
28
+
29
+ RUN pip install --no-cache-dir --upgrade -r ./requirements.txt
30
+
31
+ ENTRYPOINT ["litellm", "--config", "config.yaml", "--port", "7860", "--telemetry", "false"]