louiecerv commited on
Commit
696601a
·
1 Parent(s): 16544ec

synx to remote

Browse files
Files changed (4) hide show
  1. Dockerfile +10 -0
  2. app.py +10 -0
  3. requirements.txt +2 -0
  4. templates/index.html +9 -0
Dockerfile ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ COPY requirements.txt .
6
+ RUN pip install --no-cache-dir -r requirements.txt
7
+
8
+ COPY . .
9
+
10
+ CMD ["gunicorn", "--bind", "0.0.0.0:$PORT", "app:app"]
app.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ app = Flask(__name__)
3
+
4
+ @app.route("/")
5
+ def hello():
6
+ return render_template("index.html")
7
+
8
+ if __name__ == "__main__":
9
+ app.run(debug=False, host='0.0.0.0', port=int(os.environ.get('PORT', 8080)))
10
+ ```
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ Flask
2
+ gunicorn
templates/index.html ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Flask on Spaces</title>
5
+ </head>
6
+ <body>
7
+ <h1>Hello from Flask on Hugging Face Spaces!</h1>
8
+ </body>
9
+ </html>