Docker packages an application and its dependencies into a container, a lightweight, isolated environment that runs consistently across machines.
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]Answer all 3 questions correctly to unlock Submit.
1What is the main advantage of a Docker container over a virtual machine?
2Which file defines how a Docker image is built?
3What instruction in a Dockerfile tells Docker which port the container listens on?
Docker packages an application and its dependencies into a container, a lightweight, isolated environment that runs consistently across machines.
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]Answer all 3 questions correctly to unlock Submit.
1What is the main advantage of a Docker container over a virtual machine?
2Which file defines how a Docker image is built?
3What instruction in a Dockerfile tells Docker which port the container listens on?