Pamudu13 commited on
Commit
cfc2089
·
verified ·
1 Parent(s): e63cd8e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -5
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
  # Use an official Python image as a base
2
- FROM python:3.9
3
 
4
  # Set the working directory
5
  WORKDIR /app
@@ -13,8 +13,13 @@ COPY requirements.txt .
13
  # Install dependencies from requirements.txt
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # Expose the port Hypercorn will run on (Hugging Face typically uses 7860)
17
- EXPOSE 7860
18
 
19
- # Run the app with Hypercorn
20
- CMD ["hypercorn", "app:app", "--bind", "0.0.0.0:7860"]
 
 
 
 
 
 
1
  # Use an official Python image as a base
2
+ FROM python:3.9-slim
3
 
4
  # Set the working directory
5
  WORKDIR /app
 
13
  # Install dependencies from requirements.txt
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # Expose the port Flask will run on (Flask default is 5000)
17
+ EXPOSE 5000
18
 
19
+ # Set the environment variable for Flask
20
+ ENV FLASK_APP=app.py
21
+ ENV FLASK_RUN_HOST=0.0.0.0
22
+ ENV FLASK_RUN_PORT=5000
23
+
24
+ # Run the app using Gunicorn
25
+ CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"]