Anvil Career
Back to Blog
DEVELOPMENT TUTORIAL

Containerize Your College Project With Docker: The One-Day Upgrade That Separates Your Portfolio From Every Other Fresher

10 min read

A hiring manager reviews two candidates with identical MERN portfolios. Candidate A's README says "npm install && npm start." Candidate B's README says "docker-compose up" and the repository contains a Dockerfile with multi-stage builds and a docker-compose.yml with the application, database, and cache services. Candidate B gets the interview. The difference in effort between these two presentations is roughly one afternoon. The difference in hiring outcome is measured in offer letters. Docker is the single highest-leverage afternoon investment you can make in your existing portfolio, and almost no tier-3 student makes it.

WHY DOCKER MATTERS TO RECRUITERS

Docker signals three things simultaneously: you understand reproducible development environments (no more "it works on my machine"), you understand service orchestration (your application talks to a database and a cache, not just a single process), and you are aware of production deployment patterns (containers are how modern applications are deployed, whether on AWS ECS, Kubernetes, or a simple VPS with Docker Compose). A student who has never written a Dockerfile has never deployed anything in a container. A student who has a Dockerfile in their repo has demonstrated containerization awareness. The recruiter notices the difference immediately.

The Multi-Stage Dockerfile That Actually Works

A single-stage Dockerfile copies everything and runs the app. It works. It is also bloated. It includes devDependencies in the final image. It uses the full Node image rather than the slim Alpine variant. It runs as root. These are the details that separate "I followed a Docker tutorial" from "I understand container best practices."

A multi-stage Dockerfile for a Node.js application: Stage 1 uses the full Node image to install all dependencies and build the application (TypeScript compilation, bundling, etc.). Stage 2 uses the slim Node image, copies only the built artifacts and production dependencies from Stage 1, and runs the application as a non-root user. The result is an image that is 60–80% smaller than the single-stage equivalent, contains no build tools or devDependencies, and runs with minimal attack surface. The Dockerfile is 20 lines. The recruiter who reviews it recognizes the multi-stage pattern and knows you understand production containerization, not just containerization-for-tutorials.

The docker-compose.yml That Proves You Understand Service Architecture

A docker-compose file that starts only your Node app is useful but unimpressive. A docker-compose file that starts your app, a Postgres database, and a Redis cache, with health checks, volume mounts for data persistence, and environment variable files — that is the file that gets you the interview.

The structure: services for app, db (Postgres), and cache (Redis). The app service depends_on db and cache with a healthcheck condition (the app does not start until the database is healthy). The db service mounts a volume for data persistence (restarting the container does not wipe the database). All services share a Docker network. Environment variables come from an .env file (not hardcoded in the compose file). This structure is a microcosm of how production applications are orchestrated. A recruiter who sees this file knows you can reason about multi-service architectures. That is the skill that separates junior engineers who get production responsibilities from those who get assigned bug fixes.

DOCKER BEST PRACTICES: TUTORIAL LEVEL VS. PRODUCTION LEVEL

PRACTICE TUTORIAL DOCKERFILE PRODUCTION-READY DOCKERFILE
Base image node:latest (unpinned, full image, ~950MB) node:20-alpine (pinned version, 120MB)
Build stages Single stage. Dev dependencies in final image. Multi-stage. Build in stage 1, copy artifacts to stage 2. Production-only deps.
User Runs as root. Container compromise = host compromise. USER node. Runs as non-root user. Minimal attack surface.
.dockerignore Missing. node_modules, .git, and .env copied into image. Present. Excludes node_modules, .git, .env, and build artifacts.
THE AFTERNOON DOCKER UPGRADE

Take your existing project. Add a multi-stage Dockerfile following the pattern above. Add a docker-compose.yml with your app, database, and cache services. Add a .dockerignore file. Test with docker-compose up. Update your README with docker-compose instructions as the primary setup method. Push to GitHub. Total time: one afternoon. Recruiter signal change: from "localhost developer" to "infrastructure-aware engineer." This is the highest-ROI afternoon you can spend on your portfolio, and it requires zero changes to your application code.