srivatsavdamaraju commited on
Commit
0ec1c2e
·
verified ·
1 Parent(s): eb49c06

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -12
Dockerfile CHANGED
@@ -1,20 +1,24 @@
1
- # Use an official Python runtime as a base image
2
  FROM python:3.9-slim
3
 
4
- # Set environment variables to avoid Python output buffering
5
- ENV PYTHONUNBUFFERED 1
6
-
7
- # Set the working directory inside the container
8
  WORKDIR /app
9
 
10
- # Copy the current directory contents into the container at /app
11
- COPY . /app
12
 
13
- # Install any needed dependencies
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # Expose the port Flask will run on (default is 5000)
17
- EXPOSE 5000
 
 
 
 
 
 
 
 
18
 
19
- # Command to run the Flask app
20
- CMD ["python", "app.py"]
 
1
+ # Use the official Python base image
2
  FROM python:3.9-slim
3
 
4
+ # Set a working directory
 
 
 
5
  WORKDIR /app
6
 
7
+ # Install dependencies
8
+ COPY requirements.txt .
9
 
 
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
+ # Copy the Flask application to the container
13
+ COPY . .
14
+
15
+ # Expose the port that the app will run on (Hugging Face Spaces typically uses port 7860)
16
+ EXPOSE 7860
17
+
18
+ # Set environment variables for Flask and Gunicorn
19
+ ENV FLASK_APP=app.py
20
+ ENV FLASK_RUN_HOST=0.0.0.0
21
+ ENV FLASK_RUN_PORT=7860
22
 
23
+ # Command to run the Flask app with gunicorn
24
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]