File size: 823 Bytes
526eb13
 
 
 
 
 
 
 
2886641
526eb13
 
 
 
 
 
 
 
2886641
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

NAME="project_settings"                                  # Name of the application
DJANGODIR=/app             # Django project directory
SOCKFILE=/app/run/gunicorn.sock  # we will communicte using this unix socket
NUM_WORKERS=3                                     # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=project_settings.settings             # which settings file should Django use
DJANGO_WSGI_MODULE=project_settings.wsgi                     # WSGI module name
PORT=7860  # Specify the port number

echo "Starting $NAME as `whoami`"

# Create the run directory if it doesn't exist
RUNDIR=$(dirname $SOCKFILE)
test -d $RUNDIR || mkdir -p $RUNDIR

# Start your Django Gunicorn
gunicorn project_settings.wsgi:application --bind=0.0.0.0:$PORT --workers $NUM_WORKERS --timeout 600