mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-23 05:08:32 +00:00
Fixes all the paths and routing errors
This commit is contained in:
parent
d9d1367556
commit
cb2613feee
@ -23,8 +23,8 @@ WORKDIR /app
|
|||||||
ENV FLASK_APP=/app/crc/__init__.py
|
ENV FLASK_APP=/app/crc/__init__.py
|
||||||
|
|
||||||
# Don't run gunicorn until the DC/OS container actually starts.
|
# Don't run gunicorn until the DC/OS container actually starts.
|
||||||
# Otherwise, environment variables will not be availabele.
|
# Otherwise, environment variables will not be available.
|
||||||
#CMD ["pipenv", "run", "gunicorn", \
|
#CMD ["pipenv", "run", "gunicorn", \
|
||||||
# "--bind", "0.0.0.0:8000", \
|
# "--bind", "0.0.0.0:8000", \
|
||||||
# "-e", "SCRIPT_NAME=/api", \
|
# "-e", "SCRIPT_NAME=/api", \
|
||||||
# "crc:app"]
|
# "wsgi:app"]
|
||||||
|
1
Pipfile
1
Pipfile
@ -37,6 +37,7 @@ pandas = "*"
|
|||||||
xlrd = "*"
|
xlrd = "*"
|
||||||
ldap3 = "*"
|
ldap3 = "*"
|
||||||
gunicorn = "*"
|
gunicorn = "*"
|
||||||
|
werkzeug = "*"
|
||||||
|
|
||||||
[requires]
|
[requires]
|
||||||
python_version = "3.7"
|
python_version = "3.7"
|
||||||
|
3
Pipfile.lock
generated
3
Pipfile.lock
generated
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"hash": {
|
"hash": {
|
||||||
"sha256": "5363eb56e2e1622e2c443647fdf0b1963f3d0ee7b25c61f7065a542e546ece5b"
|
"sha256": "fad2f86b02a85b074e8ff9d8f3822784444d0925b0bf4227d4b26bbff1c45c2f"
|
||||||
},
|
},
|
||||||
"pipfile-spec": 6,
|
"pipfile-spec": 6,
|
||||||
"requires": {
|
"requires": {
|
||||||
@ -863,6 +863,7 @@
|
|||||||
"sha256:2de2a5db0baeae7b2d2664949077c2ac63fbd16d98da0ff71837f7d1dea3fd43",
|
"sha256:2de2a5db0baeae7b2d2664949077c2ac63fbd16d98da0ff71837f7d1dea3fd43",
|
||||||
"sha256:6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c"
|
"sha256:6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c"
|
||||||
],
|
],
|
||||||
|
"index": "pypi",
|
||||||
"version": "==1.0.1"
|
"version": "==1.0.1"
|
||||||
},
|
},
|
||||||
"xlrd": {
|
"xlrd": {
|
||||||
|
@ -18,4 +18,4 @@ if [ "$RESET_DB" = "true" ]; then
|
|||||||
pipenv run flask load-example-data
|
pipenv run flask load-example-data
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pipenv run gunicorn -e SCRIPT_NAME="$APPLICATION_ROOT" --bind 0.0.0.0:$PORT0 run:app
|
pipenv run gunicorn -e SCRIPT_NAME="$APPLICATION_ROOT" --bind 0.0.0.0:$PORT0 wsgi:app
|
||||||
|
20
wsgi.py
Normal file
20
wsgi.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
from werkzeug.exceptions import NotFound
|
||||||
|
from werkzeug.middleware.dispatcher import DispatcherMiddleware
|
||||||
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||||
|
|
||||||
|
from crc import app
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
def no_app(environ, start_response):
|
||||||
|
return NotFound()(environ, start_response)
|
||||||
|
|
||||||
|
|
||||||
|
# Remove trailing slash, but add leading slash
|
||||||
|
base_url = '/' + app.config['APPLICATION_ROOT'].strip('/')
|
||||||
|
|
||||||
|
app.wsgi_app = DispatcherMiddleware(no_app, {app.config['APPLICATION_ROOT']: app.wsgi_app})
|
||||||
|
app.wsgi_app = ProxyFix(app.wsgi_app)
|
||||||
|
|
||||||
|
flask_port = app.config['FLASK_PORT']
|
||||||
|
|
||||||
|
app.run(host='0.0.0.0', port=flask_port)
|
Loading…
x
Reference in New Issue
Block a user