1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-23 07:52:23 +00:00

Working Docker production env

This commit is contained in:
Alexandre Iooss 2020-09-01 14:16:18 +02:00
parent 55be6be6c5
commit bfd08fec09

View File

@ -5,10 +5,10 @@
if [ -z ${NOTE_URL+x} ]; then
echo "Warning: your env files are not configurated."
else
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
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
sed -i -e "s/example.com/$DOMAIN/g" /var/www/note_kfet/apps/member/fixtures/initial.json
sed -i -e "s/localhost/$NOTE_URL/g" /var/www/note_kfet/note_kfet/fixtures/initial.json
sed -i -e "s/\"\.\*\"/\"https?:\/\/$NOTE_URL\/.*\"/g" /var/www/note_kfet/note_kfet/fixtures/cas.json
sed -i -e "s/REPLACEME/La Note Kfet \\\\ud83c\\\\udf7b/g" /var/www/note_kfet/note_kfet/fixtures/cas.json
fi
# Set up Django project
@ -24,8 +24,9 @@ if [ "$1" ]; then
else
# Launch server
if [ "$DJANGO_APP_STAGE" = "prod" ]; then
# FIXME: serve static files
uwsgi --http 0.0.0.0:8080 --master --module note_kfet.wsgi --processes 4
uwsgi --http-socket 0.0.0.0:8080 --master --plugins python3 \
--module note_kfet.wsgi:application --env DJANGO_SETTINGS_MODULE=note_kfet.settings \
--processes 4 --static-map /static=/var/www/note_kfet/static --harakiri=20 --max-requests=5000 --vacuum
else
python3 manage.py runserver 0.0.0.0:8080;
fi