0
0
Remixframework~10 mins

Docker containerization in Remix - 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 a Dockerfile.

Remix
FROM [1]
Drag options to blanks, or click blank then click option'
Anode:18-alpine
Bpython:3.9
Cmysql:8
Dubuntu:latest
Attempts:
3 left
💡 Hint
Common Mistakes
Using a base image that does not have Node.js installed.
Choosing a heavy image that slows down the build.
2fill in blank
medium

Complete the Dockerfile command to copy the app files into the container.

Remix
COPY [1] /app
Drag options to blanks, or click blank then click option'
Adist
Bnode_modules
Cpackage.json
D.
Attempts:
3 left
💡 Hint
Common Mistakes
Copying only package.json without source files.
Copying node_modules which should be installed inside the container.
3fill in blank
hard

Fix the error in the Dockerfile command to install dependencies.

Remix
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 which runs the app instead of installing.
Using npm build which is not a valid npm command.
4fill in blank
hard

Fill both blanks to expose the correct port and set the command to start the Remix app.

Remix
EXPOSE [1]
CMD ["npm", "[2]"]
Drag options to blanks, or click blank then click option'
Astart
B3000
Cbuild
D8080
Attempts:
3 left
💡 Hint
Common Mistakes
Exposing the wrong port like 8080.
Using npm build instead of npm start.
5fill in blank
hard

Fill all three blanks to create a multi-stage Dockerfile that builds and runs the Remix app efficiently.

Remix
FROM node:18-alpine AS builder
WORKDIR /app
COPY [1] /app
RUN npm [2]
RUN npm run [3]

FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app /app
CMD ["npm", "start"]
Drag options to blanks, or click blank then click option'
A.
Binstall
Cbuild
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Copying only package.json in the build stage.
Skipping the build step.
Using npm start in the build stage instead of npm run build.