ruslanmv commited on
Commit
08f13c5
·
1 Parent(s): ab13e37
Files changed (3) hide show
  1. Dockerfile +17 -0
  2. app.py +2 -2
  3. requirements.txt +2 -1
Dockerfile ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python base image
2
+ FROM python:3.9
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Copy application files
8
+ COPY . /app
9
+
10
+ # Install dependencies
11
+ RUN pip install --no-cache-dir flask gunicorn
12
+
13
+ # Expose default Hugging Face Spaces port
14
+ EXPOSE 7860
15
+
16
+ # Launch the app with Gunicorn
17
+ CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
app.py CHANGED
@@ -4,7 +4,7 @@ app = Flask(__name__)
4
 
5
  @app.route('/')
6
  def hello_world():
7
- return 'Hello World!'
8
 
9
  if __name__ == '__main__':
10
- app.run(host='0.0.0.0', port=7860)
 
4
 
5
  @app.route('/')
6
  def hello_world():
7
+ return "Hello, World from Hugging Face Space!"
8
 
9
  if __name__ == '__main__':
10
+ app.run(host='0.0.0.0', debug=True)
requirements.txt CHANGED
@@ -1 +1,2 @@
1
- Flask
 
 
1
+ flask
2
+ gunicorn