0
0
Expressframework~10 mins

Docker containerization in Express - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the base image in the Dockerfile.

Express
FROM [1]
Drag options to blanks, or click blank then click option'
Amysql:8
Bnode:18-alpine
Cubuntu:latest
Dpython:3.12
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a Python or MySQL image instead of Node.js.
Using a heavy Ubuntu image unnecessarily.
2fill in blank
medium

Complete the Dockerfile line to copy your app files into the container.

Express
COPY [1] /app
Drag options to blanks, or click blank then click option'
A.
Bnode_modules
Cpackage.json
DDockerfile
Attempts:
3 left
💡 Hint
Common Mistakes
Copying only package.json misses other app files.
Copying node_modules is not recommended.
3fill in blank
hard

Fix the error in the Dockerfile command to install dependencies.

Express
RUN npm [1]
Drag options to blanks, or click blank then click option'
Ainstall
Bstart
Cbuild
Dtest
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'npm start' instead of 'npm install' in the Dockerfile.
Trying to build or test before installing dependencies.
4fill in blank
hard

Fill both blanks to expose the correct port and set the container's working directory.

Express
WORKDIR [1]
EXPOSE [2]
Drag options to blanks, or click blank then click option'
A/app
B3000
C/usr/src/app
D8080
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong working directory path.
Exposing a port not used by the app.
5fill in blank
hard

Fill both blanks to define the command that starts the Express app.

Express
CMD ["[1]", "[2]"]
Drag options to blanks, or click blank then click option'
Anode
Bapp.js
Cserver.js
Dnpm
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'npm' instead of 'node' in CMD.
Using wrong script file names.