Complete the Dockerfile to specify the base image.
FROM [1]The base image python:3.12-slim ensures a consistent Python 3.12 environment across teams.
Complete the Dockerfile to copy the application code into the container.
COPY [1] /appUsing COPY . /app copies the current directory contents into the container's /app folder.
Fix the error in the Dockerfile command to install dependencies.
RUN pip install -r [1]The standard file for Python dependencies is requirements.txt. Using this ensures pip installs the correct packages.
Fill both blanks to expose the container port and set the default command.
EXPOSE [1] CMD ["[2]"]
Port 8080 is commonly used for web apps. The command python starts the Python interpreter or script.
Fill all three blanks to create a Docker Compose service for the app.
services:
web:
image: [1]
ports:
- "[2]:[3]"The service uses the image myapp:latest. It maps port 8080 on the host to port 80 in the container, a common web port.