Skip to content

Commit

Permalink
Add example-flask-index-upload
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Mar 4, 2016
1 parent cbe4669 commit ce0f3e6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions example-flask-index-upload/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM tiangolo/uwsgi-nginx-flask:flask-index-upload

COPY ./app /app
13 changes: 13 additions & 0 deletions example-flask-index-upload/app/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from flask import Flask, send_file
app = Flask(__name__)

@app.route("/hello")
def hello():
return "Hello World from Flask"

@app.route("/")
def main():
return send_file('./static/index.html')

if __name__ == "__main__":
app.run(host='0.0.0.0', debug=True, port=80)
10 changes: 10 additions & 0 deletions example-flask-index-upload/app/static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index</title>
</head>
<body>
<h1>Hello World from HTML</h1>
</body>
</html>
7 changes: 7 additions & 0 deletions example-flask-index-upload/app/uwsgi.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[uwsgi]
socket = /tmp/uwsgi.sock
chown-socket = nginx:nginx
chmod-socket = 664

module = main
callable = app

0 comments on commit ce0f3e6

Please sign in to comment.