Skip to content

Commit ce0f3e6

Browse files
committed
Add example-flask-index-upload
1 parent cbe4669 commit ce0f3e6

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM tiangolo/uwsgi-nginx-flask:flask-index-upload
2+
3+
COPY ./app /app
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from flask import Flask, send_file
2+
app = Flask(__name__)
3+
4+
@app.route("/hello")
5+
def hello():
6+
return "Hello World from Flask"
7+
8+
@app.route("/")
9+
def main():
10+
return send_file('./static/index.html')
11+
12+
if __name__ == "__main__":
13+
app.run(host='0.0.0.0', debug=True, port=80)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Index</title>
6+
</head>
7+
<body>
8+
<h1>Hello World from HTML</h1>
9+
</body>
10+
</html>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[uwsgi]
2+
socket = /tmp/uwsgi.sock
3+
chown-socket = nginx:nginx
4+
chmod-socket = 664
5+
6+
module = main
7+
callable = app

0 commit comments

Comments
 (0)