Skip to content

Commit

Permalink
Merge pull request #151 from NHSDigital/fix-local-startup-script
Browse files Browse the repository at this point in the history
Pass environment to function app when running locally
  • Loading branch information
steventux authored Jan 30, 2025
2 parents a38b6f6 + aaf3838 commit b9ca765
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "Set up database and migrate to latest version..."
ENV_FILE=${ENV_FILE} alembic upgrade head

echo "Starting the API function app..."
cd src/notify && func start --verbose
cd src/notify && ENV_FILE="../../${ENV_FILE}" func start --verbose
1 change: 0 additions & 1 deletion src/notify/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ RUN pip install pipenv
RUN pipenv install --system

COPY . /home/site/wwwroot
COPY --from=root_dir ./database/schema.sql /home/site/wwwroot/database/schema.sql
5 changes: 5 additions & 0 deletions src/notify/function_app.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import azure.functions as func
from app import create_app
import dotenv
import os

funcapp = func.FunctionApp()
flaskapp = create_app()

if "ENV_FILE" in os.environ:
dotenv.load_dotenv(os.environ["ENV_FILE"])


@funcapp.route(
route="{*route}",
Expand Down

0 comments on commit b9ca765

Please sign in to comment.