Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #227 from communitiesuk/FS-4561-upgrade-dependencies
Browse files Browse the repository at this point in the history
FS-4561: Upgrade dependencies
  • Loading branch information
hamzabinkhalid authored Jul 23, 2024
2 parents c4a7a05 + 3b2b5fd commit b48b9c5
Show file tree
Hide file tree
Showing 14 changed files with 383 additions and 246 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FLASK_APP=app.py
FLASK_APP=app:application
FLASK_ENV=development
FLASK_RUN_PORT=5000
FLASK_RUN_HOST=localhost
Expand Down
2 changes: 1 addition & 1 deletion .flaskenv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FLASK_APP=app.py
FLASK_APP=app:application
FLASK_ENV=development
FLASK_RUN_PORT=5000
FLASK_RUN_HOST=localhost
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ WORKDIR /app
COPY requirements-dev.txt requirements-dev.txt
RUN pip --no-cache-dir install --ignore-installed distlib -r requirements-dev.txt
RUN pip install gunicorn
RUN pip install uvicorn
COPY . .

EXPOSE 8080

CMD bash -c "flask db upgrade && gunicorn -w 1 -b 0.0.0.0:8080 app:create_app()"
CMD ["gunicorn", "--worker-class", "uvicorn.workers.UvicornWorker", "wsgi:app", "-b", "0.0.0.0:8080"]
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: gunicorn wsgi:app -c run/gunicorn/devtest.py
web: gunicorn --worker-class uvicorn.workers.UvicornWorker -c run/gunicorn/devtest.py wsgi:app
10 changes: 5 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

import connexion
from flask import Flask
from connexion import FlaskApp
from fsd_utils import init_sentry
from fsd_utils.healthchecks.checkers import DbChecker
from fsd_utils.healthchecks.checkers import FlaskRunningChecker
Expand All @@ -15,13 +15,11 @@
from db import migrate


def create_app() -> Flask:
def create_app() -> FlaskApp:
init_sentry()
connexion_options = {"swagger_url": "/"}
connexion_app = connexion.FlaskApp(
__name__,
specification_dir=Config.FLASK_ROOT + "/openapi/",
options=connexion_options,
)
connexion_app.add_api(Config.FLASK_ROOT + "/openapi/api.yml")

Expand All @@ -42,7 +40,9 @@ def create_app() -> Flask:
health.add_check(FlaskRunningChecker())
health.add_check(DbChecker(db))

return flask_app
return connexion_app


app = create_app()

application = app.app
2 changes: 1 addition & 1 deletion requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ black
debugpy
deepdiff
pre-commit
pytest
pytest>=8.3.1
pytest-env
pytest-flask
pytest-mock
Expand Down
Loading

0 comments on commit b48b9c5

Please sign in to comment.