Harisri commited on
Commit
a962cf1
·
verified ·
1 Parent(s): 64acc47

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -0
Dockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python image as a base
2
+ FROM python:3.10-slim
3
+
4
+ # Set the working directory inside the container
5
+ WORKDIR /app
6
+
7
+ # Copy the requirements file first to leverage Docker layer caching
8
+ COPY requirements.txt requirements.txt
9
+
10
+ # Install the Python dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Copy the rest of your application code into the container
14
+ COPY . .
15
+
16
+ # Expose the port that Hugging Face Spaces expects
17
+ EXPOSE 7860
18
+
19
+ # The command to run your Gunicorn server, binding to the correct host and port
20
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--worker-tmp-dir", "/dev/shm", "--timeout", "120", "app:app"]