Complete the code to specify the base image for a Rails app Dockerfile.
FROM [1]The base image for a Rails app typically uses a Ruby image, such as ruby:3.2.
Complete the code to copy the Gemfile into the Docker image.
COPY [1] /usr/src/app/GemfileThe Gemfile must be copied to the image to install gems.
Fix the error in the command to install gems in the Dockerfile.
RUN bundle [1]bundle update which updates gems but does not install missing ones.bundle remove which removes gems.The correct command to install gems is bundle install.
Fill both blanks to expose the correct port and set the working directory.
EXPOSE [1] WORKDIR [2]
Rails apps usually run on port 3000, and the working directory is often set to /usr/src/app inside the container.
Fill all three blanks to run the Rails server with the correct command and environment.
CMD ["rails", "[1]", "-b", "0.0.0.0", "-e", "[2]", "-p", "[3]"]
The command runs the Rails server in production mode on port 3000, binding to all interfaces.
