0PricingLogin
Django Academy · Lesson

Writing a Django Dockerfile

Build a slim, layered image for your app.

Why a Dockerfile

A Dockerfile is a recipe that builds your app into a portable image, so it runs the same on your laptop and any server. 🐳

Pick a Base Image

Start every Dockerfile with FROM, choosing a slim Python base so your image stays small and fast to ship.

FROM python:3.12-slim

All lessons in this course

  1. Writing a Django Dockerfile
  2. docker-compose with Postgres and Redis
  3. Entrypoints, Migrations, and collectstatic
  4. Production Image Best Practices
← Back to Django Academy