The setup problem
You build a web app on your laptop. It runs because your machine has the right Node, Python, Java, database client, environment variables, and port settings.
Then your teammate clones it in hostel Wi-Fi before a hackathon demo. It fails. Their laptop has a different version, missing package, or no database running.
One idea
Docker makes your app’s running setup explicit. Instead of saying “install some things and try npm start”, you describe the OS-level environment, dependencies, ports, variables, storage, and start command.
What Docker adds
A Dockerfile is a text file with commands used to assemble an image. The image is the packaged version of your app setup.
A container is a running copy of that image. If the image is built the same way, the app has a much better chance of running the same way on another laptop.
Plain project story
Without Docker, your README may depend on hidden local setup. With Docker, the important setup starts moving into files that a reviewer can run.
You will write the real Dockerfile in the next lesson. For now, notice the shape: choose a base, set a folder, copy code, install dependencies, start the app.
FROM node:22-alpine
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "./src/index.js"]Where Compose fits
Most useful web apps need more than one process. For example, your app plus Postgres. Docker Compose is used to run these services together from one Compose file.
Current Docker teaching uses the integrated command form: docker compose. Older tutorials may show docker-compose with a hyphen. Treat that as old style when you are learning today.
Common wrong belief
Docker is not just for final deployment. It is also for local development, judging, internships, and team projects where someone else must run your app quickly.
Another mistake is thinking Docker removes the need for a README. It does not. A good repo still tells the reviewer what file to create and what one command to run.
Use AI carefully
You can ask ChatGPT, Gemini, or Claude to draft a Dockerfile explanation for your stack. Give it your package manager, start command, app port, and database choice.
Check the answer. It should not use old docker-compose commands as the main path. It should not hardcode secrets. It should explain which port the app listens on.
Do this now
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done