-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·29 lines (24 loc) · 1.02 KB
/
docker-entrypoint.sh
File metadata and controls
executable file
·29 lines (24 loc) · 1.02 KB
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
#!/bin/bash
python manage.py migrate # Apply database migrations
python manage.py collectstatic --noinput # Collect static files
echo "from django.contrib.auth.models import User; User.objects.filter(email='admin@example.com').delete(); User.objects.create_superuser('admin', 'admin@example.com', 'nimda')" | python manage.py shell
# Prepare log files and start outputting logs to stdout
touch $DOCKYARD_SRVLOGS/gunicorn.log
touch $DOCKYARD_SRVLOGS/access.log
tail -n 0 -f $DOCKYARD_SRVLOGS/*.log &
echo Starting Nginx
service nginx start
echo Starting redis
redis-server --daemonize yes
echo Starting rq workers
exec python $DOCKYARD_SRVHOME/lcc/stars_processing/systematic_search/worker.py &
# Start Gunicorn processes
echo Starting Gunicorn.
exec gunicorn LCCwebApp.wsgi:application \
--name LCCwebApp \
--bind 127.0.0.1:$DOCKYARD_PORT \
--workers $DOCKYARD_WORKERS \
--timeout 300 \
--log-level=info \
--log-file=$DOCKYARD_SRVLOGS/gunicorn.log \
--access-logfile=$DOCKYARD_SRVLOGS/access.log