Django on

I wrote about some caveats I found while running Django on fly: Django + = ❤️ | Josef's Blog

1 Like

Thanks for this, @joseferben! I’m wondering about the swap files, where should I put in those commands? Is that in your Dockerfile?

I have it in my starting script

set -e

# Set up swapping
fallocate -l 512M /swapfile
chmod 0600 /swapfile
mkswap /swapfile
echo 10 > /proc/sys/vm/swappiness
swapon /swapfile

gunicorn config.wsgi:application -b --workers=2 --capture-output --enable-stdio-inheritance

Which is run by

  web = "sh /app/scripts/"
  worker = "sh /app/scripts/"