Rsnarsna commited on
Commit
3df0d12
·
verified ·
1 Parent(s): 77944d9

Update Docker

Browse files
Files changed (1) hide show
  1. Docker +40 -0
Docker CHANGED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Use the official Python 3.9 image
2
+ FROM python:3.10
3
+
4
+ # ENV http_proxy="http://130.162.148.105:8080"
5
+ # ENV https_proxy="http://72.10.164.178:1417"
6
+ # ENV no_proxy="localhost,127.0.0.1"
7
+
8
+ ## set the working directory to /code
9
+ WORKDIR /code
10
+
11
+ ## Copy the current directory contents in the container at /code
12
+ COPY ./requirements.txt /code/requirements.txt
13
+
14
+ ## Install the requirements.txt
15
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
16
+ RUN pip install --no-cache-dir --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
17
+
18
+
19
+ # Set up a new user named "user"
20
+ RUN useradd user
21
+ # Switch to the "user" user
22
+ USER user
23
+
24
+ # Set home to the user's home directory
25
+
26
+ ENV HOME=/home/user \
27
+ PATH=/home/user/.local/bin:$PATH
28
+
29
+ # Set the working directory to the user's home directory
30
+ WORKDIR $HOME/app
31
+
32
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
33
+ COPY --chown=user . $HOME/app
34
+
35
+
36
+ # Verify files copied correctly by listing them
37
+ RUN ls -la $HOME/app
38
+
39
+ ## Start the FASTAPI App on port 7860
40
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]