diff options
Diffstat (limited to 'clover/controller/process')
-rw-r--r-- | clover/controller/process/__init__.py | 11 | ||||
-rwxr-xr-x | clover/controller/process/gunicorn_process.sh | 11 | ||||
-rw-r--r-- | clover/controller/process/nginx.conf | 18 | ||||
-rwxr-xr-x | clover/controller/process/nginx_process.sh | 11 | ||||
-rwxr-xr-x | clover/controller/process/start_process.sh | 15 |
5 files changed, 66 insertions, 0 deletions
diff --git a/clover/controller/process/__init__.py b/clover/controller/process/__init__.py new file mode 100644 index 0000000..d67a6c0 --- /dev/null +++ b/clover/controller/process/__init__.py @@ -0,0 +1,11 @@ +from flask import Flask, Response + + +app = Flask(__name__) + +@app.route("/") +def index(): + return Response("It works!"), 200 + +if __name__ == "__main__": + app.run(debug=True) diff --git a/clover/controller/process/gunicorn_process.sh b/clover/controller/process/gunicorn_process.sh new file mode 100755 index 0000000..033596f --- /dev/null +++ b/clover/controller/process/gunicorn_process.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +# Copyright (c) Authors of Clover +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# + +gunicorn --bind 0.0.0.0:8000 --chdir /control wsgi diff --git a/clover/controller/process/nginx.conf b/clover/controller/process/nginx.conf new file mode 100644 index 0000000..5b26922 --- /dev/null +++ b/clover/controller/process/nginx.conf @@ -0,0 +1,18 @@ +worker_processes auto; +pid /run/nginx.pid; + +events { + worker_connections 768; +} + + +http { + server { + listen 80; + + location / { + include proxy_params; + proxy_pass http://localhost:8000; + } + } +} diff --git a/clover/controller/process/nginx_process.sh b/clover/controller/process/nginx_process.sh new file mode 100755 index 0000000..953719d --- /dev/null +++ b/clover/controller/process/nginx_process.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +# Copyright (c) Authors of Clover +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# + +service nginx restart diff --git a/clover/controller/process/start_process.sh b/clover/controller/process/start_process.sh new file mode 100755 index 0000000..0c8ce11 --- /dev/null +++ b/clover/controller/process/start_process.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# +# Copyright (c) Authors of Clover +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# + +# Start nginx +./nginx_process.sh + +# Start gunicorn +./gunicorn_process.sh |