Gaykar commited on
Commit
ac754f0
·
verified ·
1 Parent(s): 7d3ce75

Upload 2 files

Browse files

docker file added.

Files changed (2) hide show
  1. Dockerfile +32 -0
  2. requirements.txt +0 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ # Set the working directory to /code
4
+ WORKDIR /code
5
+
6
+ # Copy the requirements.txt file into the container
7
+ COPY requirements.txt .
8
+
9
+ # Install the dependencies
10
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
+
12
+ # Set up a new user named "user" with user ID 1000
13
+ RUN useradd -m -u 1000 user
14
+
15
+ # Switch to the "user" user
16
+ USER user
17
+
18
+ # Set home to the user's home directory
19
+ ENV HOME=/home/user \
20
+ PATH=/home/user/.local/bin:$PATH
21
+
22
+ # Set the working directory to the user's home directory
23
+ WORKDIR $HOME/app
24
+
25
+ # Copy the current directory contents into the container at $HOME/app
26
+ COPY --chown=user . $HOME/app
27
+
28
+ # Expose the port FastAPI will run on
29
+ EXPOSE 7860
30
+
31
+ # Start the FastAPI app on port 7860 (HF Spaces default)
32
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt ADDED
Binary file (2.18 kB). View file