Spaces:
Sleeping
Sleeping
Rishabh IO
commited on
Commit
·
2e1b38a
1
Parent(s):
21523ed
simple flask app
Browse files- Dockerfile +10 -0
- app.py +15 -0
- requirements.txt +3 -0
Dockerfile
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
FROM python:3.9-slim-buster
|
4 |
+
WORKDIR /app
|
5 |
+
COPY ./requirements.txt /app
|
6 |
+
RUN pip install -r requirements.txt
|
7 |
+
COPY . .
|
8 |
+
EXPOSE 5000
|
9 |
+
ENV FLASK_APP=my_flask.py
|
10 |
+
CMD ["flask", "run", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
from flask import Flask, jsonify
|
4 |
+
|
5 |
+
app = Flask(__name__)
|
6 |
+
|
7 |
+
|
8 |
+
@app.route("/", methods=["GET"])
|
9 |
+
def say_hello():
|
10 |
+
return jsonify({"msg": "Hello from Flask"})
|
11 |
+
|
12 |
+
|
13 |
+
if __name__ == "__main__":
|
14 |
+
# Please do not set debug=True in production
|
15 |
+
app.run(host="0.0.0.0", port=5000, debug=True)
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
flask==2.2.2
|