From ce0f3e69a6e6fc039b0f67e6c8da1c860154ed23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 4 Mar 2016 16:23:43 +0100 Subject: [PATCH] Add example-flask-index-upload --- example-flask-index-upload/Dockerfile | 3 +++ example-flask-index-upload/app/main.py | 13 +++++++++++++ example-flask-index-upload/app/static/index.html | 10 ++++++++++ example-flask-index-upload/app/uwsgi.ini | 7 +++++++ 4 files changed, 33 insertions(+) create mode 100644 example-flask-index-upload/Dockerfile create mode 100644 example-flask-index-upload/app/main.py create mode 100644 example-flask-index-upload/app/static/index.html create mode 100644 example-flask-index-upload/app/uwsgi.ini diff --git a/example-flask-index-upload/Dockerfile b/example-flask-index-upload/Dockerfile new file mode 100644 index 00000000..107995ef --- /dev/null +++ b/example-flask-index-upload/Dockerfile @@ -0,0 +1,3 @@ +FROM tiangolo/uwsgi-nginx-flask:flask-index-upload + +COPY ./app /app diff --git a/example-flask-index-upload/app/main.py b/example-flask-index-upload/app/main.py new file mode 100644 index 00000000..d993d72c --- /dev/null +++ b/example-flask-index-upload/app/main.py @@ -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) diff --git a/example-flask-index-upload/app/static/index.html b/example-flask-index-upload/app/static/index.html new file mode 100644 index 00000000..309cd794 --- /dev/null +++ b/example-flask-index-upload/app/static/index.html @@ -0,0 +1,10 @@ + + + + + Index + + +

Hello World from HTML

+ + \ No newline at end of file diff --git a/example-flask-index-upload/app/uwsgi.ini b/example-flask-index-upload/app/uwsgi.ini new file mode 100644 index 00000000..b4e2ad26 --- /dev/null +++ b/example-flask-index-upload/app/uwsgi.ini @@ -0,0 +1,7 @@ +[uwsgi] +socket = /tmp/uwsgi.sock +chown-socket = nginx:nginx +chmod-socket = 664 + +module = main +callable = app \ No newline at end of file