feat: Add basic docker support

This commit is contained in:
2024-04-13 02:12:37 +02:00
parent a0f7d0188d
commit b326534905
4 changed files with 58 additions and 0 deletions

5
docker/build.cfg Normal file
View File

@@ -0,0 +1,5 @@
[django]
secret="NOTREALSECRET"
[locations]
static=/notfellchen/static
media=/notfellchen/media

22
docker/notfellchen.bash Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
set -eux
cd /app
AUTOMIGRATE=${AUTOMIGRATE:-yes}
NUM_WORKERS_DEFAULT=$((2 * $(nproc --all)))
export NUM_WORKERS=${NUM_WORKERS:-$NUM_WORKERS_DEFAULT}
if [ "$AUTOMIGRATE" != "skip" ]; then
nf migrate --noinput
fi
exec gunicorn notfellchen.wsgi \
--name notfellchen \
--workers $NUM_WORKERS \
--max-requests 1200 \
--max-requests-jitter 50 \
--log-level=info \
--bind 0.0.0.0:8345