-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from fortify-presales/python-migration
Python migration
- Loading branch information
Showing
10 changed files
with
65 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,9 @@ You can the run the application locally using the following: | |
python -m venv .venv | ||
.venv\Scripts\Activate.ps1 [Windows] | ||
.venv/Scripts/activate [Linux/UNIX] | ||
pip install -r app\requirements.txt | ||
flask run | ||
pip install -r requirements.txt | ||
run.bat [Windows] | ||
ruh.sh [Linux/UNIX] | ||
``` | ||
|
||
The application should then be available at the URL `http://localhost:5000`. If it fails to start, | ||
|
@@ -32,6 +33,39 @@ functional in this version of the app: | |
|
||
These have been "enabled" because they all have potential security issues that can be found by Fortify. | ||
|
||
Deploy Application (Azure) | ||
-------------------------- | ||
|
||
If you want to run the application in the cloud you can deploy it to Microsoft Azure along with its required | ||
infrastructure by using the Azure DevOps CLI. | ||
|
||
To create the required infrastructure and deploy the application you can execute the following (from a Windows command prompt): | ||
|
||
``` | ||
az login | ||
az webapp up --runtime PYTHON:3.12 --location eastus --name _YOUR_APP_NAME__ --sku B1 --logs | ||
``` | ||
|
||
Replace `eastus` with your own desired region and `B1` with desired app service plan. | ||
|
||
You will need to create a custom startup script for the application using the resource_group and app_name from above: | ||
|
||
``` | ||
az webapp config set --resource-group _YOUR_RESOURCE_GROUP_ --name _YOUR_APP_NAME_ --startup-file startup.txt | ||
``` | ||
|
||
You should now be able to navigate to the website and use the URL `http://your_website_name.azurewebsites.net/init-db` | ||
to populate the database. | ||
|
||
Remove Application and Infrastructure | ||
------------------------------------- | ||
|
||
To clean up all the resources you can execute the following (from a Windows command prompt): | ||
|
||
``` | ||
az group delete --name [resource_group_created_from_above] --no-wait | ||
``` | ||
|
||
--- | ||
|
||
Kevin A. Lee (kadraman) - [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
gunicorn --bind=0.0.0.0 --timeout 600 'app:create_app()' |