The (near) Perfect Dockerfile for Django Applications
Prerequisites- This article assumes an intermediate level understanding of Docker and Django based application development.
Docker has revolutionized software development and has proven to be the nucleus of new-age development practices like CI-CD, d...
siddharthsahu.com10 min read
Nice article! I don't really embrace running makemigrations inside the container and then migrate, if a developer for whatever reason remove a model or a model field this is going to be destructive! Making migrations should be part of the developer's task and generated migrations files should go into review before deploying a new version of the software. It's a good practice to have
./manage.py makemigrations --checkinto your CI step too to avoid forgetting about migrations files. For k8s users, initcontainers or k8s jobs could be a better place to run migrate command (If using ArgoCD presync hooks are even better).