From bfd08fec096fff78048f7df022c022b409aa4b94 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Tue, 1 Sep 2020 14:16:18 +0200 Subject: [PATCH] Working Docker production env --- entrypoint.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index f677b496..ab33fbe8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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