bigbossmonster commited on
Commit
09af3ee
·
verified ·
1 Parent(s): 5e29d1f

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+
3
+ # Set the working directory to /app
4
+ WORKDIR /app
5
+
6
+ # Copy the requirements file from your local machine to the container
7
+ COPY requirements.txt .
8
+
9
+ # Install the dependencies listed in requirements.txt
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
+
12
+ # Copy the rest of your application code
13
+ COPY . .
14
+
15
+ # Create a non-root user (Security requirement for some HF Spaces)
16
+ RUN useradd -m -u 1000 user
17
+ USER user
18
+ ENV HOME=/home/user \
19
+ PATH=/home/user/.local/bin:$PATH
20
+
21
+ # Command to run the application on port 7860 (Hugging Face's default port)
22
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]