-
Notifications
You must be signed in to change notification settings - Fork 2
/
entrypoint.sh
32 lines (28 loc) · 1.15 KB
/
entrypoint.sh
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
#!/usr/bin/env bash
# Define the license template with placeholders for environment variables
# LICENSE_TEMPLATE=$(cat <<EOF
# <license id="${PRINCE_LICENSE_ID}">
# <name>Server License</name>
# <vendor>YesLogic</vendor>
# <product>Prince</product>
# <version>15</version>
# <end-user>Government of Western Australia</end-user>
# <date>2024-05-31</date>
# <signature>${PRINCE_LICENSE_SIGNATURE}</signature>
# <option id="upgrades">20250531</option>
# <option id="expires">20250531</option>
# </license>
# EOF
# )
# Output the license template to license.dat
# echo "$LICENSE_TEMPLATE" > /usr/lib/prince/license/license.dat
echo "Creating license.dat symlink..."
ln -s /usr/src/app/backend/files/license.dat /usr/lib/prince/license/license.dat
# Run Django migrations
echo "Running Django migrations..."
# DISABLED DUE TO READ ONLY FILE SYSTEM
# python manage.py makemigrations
python manage.py migrate
# Launch backend (moved from Dockerfile to run after securely setting Prince license)
echo "Launching gunicorn..."
exec gunicorn config.wsgi --bind 0.0.0.0:8000 --timeout 300 --graceful-timeout 90 --max-requests 2048 --workers 4 --preload