What is Docker?
Docker packages your app and all its dependencies into a container — a lightweight, portable environment that runs the same everywhere.
No more "it works on my machine."
Core Concepts
- Image: A blueprint for your container (like a class)
- Container: A running instance of an image (like an object)
- Dockerfile: Instructions to build an image
- Volume: Persistent storage for containers
- docker-compose: Run multiple containers together
Your First Dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]Running It
docker build -t my-app .
docker run -p 3000:3000 my-appThat's it. Your app is containerized. Visit localhost:3000.
Why Students Should Care
- Deploy projects easily for demos
- No "install X, Y, Z" for teammates
- Learn a skill every company wants