forked from ios-cv/carshare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
32 lines (26 loc) · 845 Bytes
/
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
# This is the entrypoint script for the Dockerfile
# Check that what to run is specified.
if [[ $# -eq 0 ]]; then
echo You must specify what to run.
fi
# Launch the Django webapp.
if [[ "$1" = "app" ]]; then
# Update the Django static files in the shared volume.
echo Reinitialising static files...
rm -rf /usr/src/app/static_root/*
cp -rf static/* static_root/
# Run Django migrations
python manage.py migrate
# Run the web server.
echo Launching web app...
gunicorn -w 3 -b 0.0.0.0:8000 carshare.wsgi --log-file -
fi
if [[ "$1" = "celery-beat" ]]; then
# Run the celery beat
python -m celery -A carshare beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
fi
if [[ "$1" = "celery-worker" ]]; then
# Run the celery worker
python -m celery -A carshare worker -l INFO
fi