Skip to content

Commit

Permalink
Startup script for App Service (Azure-Samples#464)
Browse files Browse the repository at this point in the history
* Startup script

* Newlines

* Change threads
  • Loading branch information
pamelafox authored Jul 28, 2023
1 parent e290962 commit 62824c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/backend/gunicorn.conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import multiprocessing

max_requests = 1000
max_requests_jitter = 50
log_file = "-"
bind = "0.0.0.0"

num_cpus = multiprocessing.cpu_count()
workers = (num_cpus * 2) + 1
threads = 1 if num_cpus == 1 else 2
timeout = 600
1 change: 1 addition & 0 deletions app/backend/start_appservice.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3 -m gunicorn app:app
1 change: 1 addition & 0 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ module backend 'core/host/appservice.bicep' = {
appServicePlanId: appServicePlan.outputs.id
runtimeName: 'python'
runtimeVersion: '3.10'
appCommandLine: 'start_appservice.sh'
scmDoBuildDuringDeployment: true
managedIdentity: true
appSettings: {
Expand Down

0 comments on commit 62824c3

Please sign in to comment.