diff --git a/src/app/main.py b/src/app/main.py index 6f3fc4c..9fbf7fa 100644 --- a/src/app/main.py +++ b/src/app/main.py @@ -1,7 +1,6 @@ from views.app import app + if __name__ == "__main__": app.run() -# Use webpy module to create a wsgi function -application = app.wsgifunc() diff --git a/src/app/views/app.py b/src/app/views/app.py index 25db067..5ccd8f8 100644 --- a/src/app/views/app.py +++ b/src/app/views/app.py @@ -10,6 +10,7 @@ from views.project import Project from views.index import Index from views.apply import Apply + # Define application routes urls = ( '/', 'Index', @@ -48,3 +49,6 @@ def session_hook(): app.add_processor(web.loadhook(session_hook)) +app = app.wsgifunc() + + diff --git a/src/entrypoint.sh b/src/entrypoint.sh index 5052949..1159474 100644 --- a/src/entrypoint.sh +++ b/src/entrypoint.sh @@ -10,6 +10,9 @@ USE_STATIC_PATH=${STATIC_PATH:-'/app/static'} # Get the listen port for Nginx, default to 8080 USE_LISTEN_PORT=${LISTEN_PORT:-8080} +#if [ -f /app/nginx.conf ]; then +# cat /app/nginx.conf > /etc/nginx/conf.d/nginx.conf +#else content_server='server {\n' content_server=$content_server" listen ${USE_LISTEN_PORT};\n" content_server=$content_server' location / {\n' @@ -21,6 +24,25 @@ content_server=$content_server" alias $USE_STATIC_PATH;\n" content_server=$content_server' }\n' content_server=$content_server'}\n' + +# Configuration skeleton for using SSL +# https://nginx.org/en/docs/http/configuring_https_servers.html +#content_server=$content_server'server {\n' +#content_server=$content_server" listen 443 ssl http2;\n" +#content_server=$content_server' ssl_certificate ;\n' +#content_server=$content_server' ssl_certificate_key ;\n' +#content_server=$content_server' ssl_protocols ;\n' +#content_server=$content_server' ssl_ciphers ;\n' +#content_server=$content_server' location / {\n' +#content_server=$content_server' include uwsgi_params;\n' +#content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n' +#content_server=$content_server' }\n' +#content_server=$content_server" location $USE_STATIC_URL {\n" +#content_server=$content_server" alias $USE_STATIC_PATH;\n" +#content_server=$content_server' }\n' +#content_server=$content_server'}\n' + + # Save generated server /etc/nginx/conf.d/nginx.conf printf "$content_server" > /etc/nginx/conf.d/nginx.conf