Skip to content

Instantly share code, notes, and snippets.

View linkdd's full-sized avatar
🙂

David Delassus linkdd

🙂
View GitHub Profile
@linkdd
linkdd / README.md
Last active February 5, 2024 11:21
Python Django Dockerfile

Python Django Dockerfile

When setting up a Python/Django project, I like to do a few things:

  • use poetry to manage dependencies and virtualenv
  • use poe to manage tasks (similar to node's scripts)
  • split the django settings.py into multiple files, with one per environment (similar to Elixir compile-time config)
  • use gunicorn and whitenoise to serve the application
  • use a multi-stage Dockerfile making heavy use of the docker layer cache to avoid running intensive steps needlessly
  • use django-tailwind and django-anymail