my
Browse files- Dockerfile +1 -1
- app.py +6 -6
- requirements.txt +2 -0
- templates/index.html +12 -0
Dockerfile
CHANGED
@@ -13,4 +13,4 @@ COPY --chown=user ./requirements.txt requirements.txt
|
|
13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
|
15 |
COPY --chown=user . /app
|
16 |
-
CMD ["
|
|
|
13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
|
15 |
COPY --chown=user . /app
|
16 |
+
CMD ["gunicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
from
|
|
|
|
|
2 |
|
3 |
-
app
|
4 |
-
|
5 |
-
|
6 |
-
def greet_json():
|
7 |
-
return {"Hello": "World!"}
|
|
|
1 |
+
from flask import Flask, render_template
|
2 |
+
import os
|
3 |
+
app = Flask(__name__)
|
4 |
|
5 |
+
@app.route("/")
|
6 |
+
def home():
|
7 |
+
return render_template("index.html") # Render HTML template
|
|
|
|
requirements.txt
CHANGED
@@ -1,2 +1,4 @@
|
|
1 |
fastapi
|
2 |
uvicorn[standard]
|
|
|
|
|
|
1 |
fastapi
|
2 |
uvicorn[standard]
|
3 |
+
gunicorn
|
4 |
+
flask
|
templates/index.html
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Hello World</title>
|
7 |
+
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
8 |
+
</head>
|
9 |
+
<body>
|
10 |
+
<h1>Hello, Flask App!</h1>
|
11 |
+
</body>
|
12 |
+
</html>
|