-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
34 lines (27 loc) · 790 Bytes
/
Copy pathstart.sh
File metadata and controls
34 lines (27 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Exit on any error
set -e
echo "Starting Techtonic application..."
# Set environment variables
export DJANGO_SETTINGS_MODULE=capstone_django.settings
# Wait for database to be ready (if needed)
echo "Waiting for database connection..."
python manage.py check --database default
# Run migrations
echo "Running database migrations..."
python manage.py migrate --noinput
# Collect static files
echo "Collecting static files..."
python manage.py collectstatic --noinput
# Start the application
echo "Starting Gunicorn server..."
exec gunicorn \
--bind 0.0.0.0:8080 \
--workers 3 \
--timeout 120 \
--keep-alive 2 \
--max-requests 1000 \
--max-requests-jitter 100 \
--access-logfile - \
--error-logfile - \
capstone_django.wsgi:application