diff --git a/compose.yml b/compose.yml index 0766e8a8..96b51dc0 100644 --- a/compose.yml +++ b/compose.yml @@ -22,12 +22,14 @@ services: profiles: - dev - communication-management: - container_name: communication-management + communication-management-api: + container_name: communication-management-api network_mode: host build: - context: . + context: ./src/communication-management-api dockerfile: Dockerfile + additional_contexts: + root_dir: . depends_on: db: condition: service_healthy diff --git a/Dockerfile b/src/communication-management-api/Dockerfile similarity index 91% rename from Dockerfile rename to src/communication-management-api/Dockerfile index 3c4fa336..6e6c7adb 100644 --- a/Dockerfile +++ b/src/communication-management-api/Dockerfile @@ -21,4 +21,4 @@ RUN pip install pipenv RUN pipenv install --system COPY . /home/site/wwwroot -COPY ./database/schema.sql /home/site/wwwroot/database/schema.sql +COPY --from=root_dir /database/schema.sql /home/site/wwwroot/database/schema.sql diff --git a/src/app.py b/src/communication-management-api/app.py similarity index 100% rename from src/app.py rename to src/communication-management-api/app.py diff --git a/src/app/__init__.py b/src/communication-management-api/app/__init__.py similarity index 100% rename from src/app/__init__.py rename to src/communication-management-api/app/__init__.py diff --git a/src/app/routes.py b/src/communication-management-api/app/routes.py similarity index 82% rename from src/app/routes.py rename to src/communication-management-api/app/routes.py index b7da3635..63009770 100644 --- a/src/app/routes.py +++ b/src/communication-management-api/app/routes.py @@ -4,5 +4,5 @@ @api.route("/status/health-check", methods=["GET"]) -def status_health_check(): +def status_health_check() -> tuple: return jsonify({"status": "healthy"}), 200 diff --git a/src/function_app.py b/src/communication-management-api/function_app.py similarity index 87% rename from src/function_app.py rename to src/communication-management-api/function_app.py index d23cfaf0..e337e3ba 100644 --- a/src/function_app.py +++ b/src/communication-management-api/function_app.py @@ -5,6 +5,7 @@ flaskapp = create_app() +@funcapp.function_name(name="CommunicationManagementAPI") @funcapp.route( route="{*route}", auth_level=func.AuthLevel.ANONYMOUS, diff --git a/src/host.json b/src/communication-management-api/host.json similarity index 100% rename from src/host.json rename to src/communication-management-api/host.json diff --git a/src/local.settings.json b/src/communication-management-api/local.settings.json similarity index 100% rename from src/local.settings.json rename to src/communication-management-api/local.settings.json diff --git a/tests/__init__.py b/tests/__init__.py index 499970f8..c9effc33 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,4 +2,5 @@ import sys SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) -sys.path.insert(0, os.path.dirname(SCRIPT_DIR) + "/../app/") +sys.path.insert(0, os.path.dirname(SCRIPT_DIR) + "/src/communication-management-api/") +print(sys.path)