📦Dockerfile
Also known as Containerfile, Docker File
A text file of steps. It builds a container image, one line at a time.
Think of it like
It is like a recipe card. Follow the steps in order, and you bake the same cake each time.
Example
Emma's file starts from an official Python image. It copies her app in and adds its packages. Anyone on her team can build the same image with one command.
Why it matters
The build lives in a file, not in someone's head. Anyone can rebuild the image, and every change is saved with the code.
Definition
Example code
dockerfile
FROM python:3.13-slim
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
CMD ["python", "app.py"]Common mistake
Key takeaways
- 1One step a line. Each line adds a layer or a setting.
- 2Order matters. Put steps that rarely change first.
- 3Kept with the code. It sits in the project, under version control.