Commit 53eead6 1 parent 79fcb57 commit 53eead6 Copy full SHA for 53eead6
File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 40
40
# ===================
41
41
if [ " ${APP_ENV^^} " = " PRODUCTION" ]; then
42
42
43
+ # if the number of workers is not set, default to 3
44
+ if [ -z " ${GUNICORN_WORKERS} " ]; then
45
+ GUNICORN_WORKERS=3
46
+ fi
47
+
48
+ # if the port is not set, default to 8081
49
+ if [ -z " ${GUNICORN_PORT} " ]; then
50
+ GUNICORN_PORT=8081
51
+ fi
52
+
43
53
# Run Gunicorn / Django
44
54
printf " \n" && echo " Running Gunicorn / Django"
45
- echo " Running: gunicorn api.wsgi -b 0.0.0.0:8081 --workers=1 --keep-alive 20 --log-file=- --log-level debug --access-logfile=/var/log/accesslogs/gunicorn --capture-output --timeout 50"
46
- gunicorn api.wsgi -b 0.0.0.0:8081 --workers=1 --keep-alive 20 --log-file=- --log-level debug --access-logfile=/var/log/accesslogs/gunicorn --capture-output --timeout 50
55
+ echo " Running: gunicorn api.wsgi -b 0.0.0.0:$GUNICORN_PORT --workers=$GUNICORN_WORKERS --keep-alive 20 --log-file=- --log-level debug --access-logfile=/var/log/accesslogs/gunicorn --capture-output --timeout 50"
56
+ gunicorn api.wsgi -b 0.0.0.0:" $GUNICORN_PORT " --workers=" $GUNICORN_WORKERS " --keep-alive 20 --log-file=- --log-level debug --access-logfile=/var/log/accesslogs/gunicorn --capture-output --timeout 50
47
57
fi
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ API_SECRET_KEY="supersecretkey"
5
5
API_ALLOWED_HOSTS = " .localhost 127.0.0.1 [::1]"
6
6
API_CORS_ALLOWED_ORIGINS = " http://localhost:3000 https://localhost:3000"
7
7
8
+ # need to set POSTGRES_HOST to the name of the container in docker-compose when using docker on production
8
9
POSTGRES_HOST = localhost
9
10
POSTGRES_NAME = postgres
10
11
POSTGRES_USER = postgres
@@ -15,4 +16,8 @@ DJANGO_SUPERUSER_PASSWORD=Password123
15
16
DJANGO_SUPERUSER_EMAIL = admin@test.com
16
17
DJANGO_SUPERUSER_USERNAME = admin
17
18
19
+ # production
20
+ GUNICORN_WORKERS = 3
21
+ GUNICORN_PORT = 8081
22
+
18
23
FRONTEND_URL = " http://localhost:3000"
You can’t perform that action at this time.
0 commit comments