1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-30 04:13:01 +00:00
nk20/entrypoint.sh

25 lines
863 B
Bash
Raw Normal View History

2020-06-21 18:27:42 +00:00
#!/bin/sh
2020-02-18 20:30:26 +00:00
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
if [ -z ${NOTE_URL+x} ]; then
echo "Warning: your env files are not configurated."
else
2020-03-11 16:51:42 +00:00
sed -i -e "s/example.com/$DOMAIN/g" /code/apps/member/fixtures/initial.json
sed -i -e "s/localhost/$NOTE_URL/g" /code/note_kfet/fixtures/initial.json
2020-03-19 15:12:52 +00:00
sed -i -e "s/\"\.\*\"/\"https?:\/\/$NOTE_URL\/.*\"/g" /code/note_kfet/fixtures/cas.json
sed -i -e "s/REPLACEME/La Note Kfet \\\\ud83c\\\\udf7b/g" /code/note_kfet/fixtures/cas.json
fi
2020-02-03 10:50:42 +00:00
python manage.py compilemessages
python manage.py makemigrations
python manage.py migrate
2020-06-21 18:27:42 +00:00
nginx
if [ "$DJANGO_APP_STAGE" = "prod" ]; then
gunicorn -b 0.0.0.0:8000 --workers=2 --threads=4 --worker-class=gthread note_kfet.wsgi --access-logfile '-' --error-logfile '-';
else
python manage.py runserver 0.0.0.0:8000;
fi