Full Stack Web Development
Step 19 / 21150 min

Docker

DevOps & Shipping

Explanation

Containers package apps with dependencies so they run the same way locally and in production.

Code example

dockerfile
FROM node:22-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
EXPOSE 3000
CMD ["npm", "run", "start"]

Helpful resources

Exercise

Dockerize your API or Next.js app and run it with docker compose including PostgreSQL.