Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1 : create an image to serve a static file. Some of your company's applications include simple static files to be served. you would
Part : create an image to serve a static file.
Some of your company's applications include simple static files to be served. you would like to create separate containers to serve static content. for testing, you can use the Python http server in the standard library, which can be run using "python m http server d to serve the files in listening on the given port.
Create a new folder homeuserwebwith a Dockerfile and a subfolder www containing a static file to be served. Write the Dockerfile so that it includes the default Python http server command to run for the web server, using port One you have assembled the necessary steps in your Dockerfile, execute the command to build it
Make a screen capture showing the successful build of the webimage
Now that your image is built, create and run a container based on ityou may do this in several steps, or use the appropriate docker command to accomplish the task in a single step. Ensure that you connect port of the docker container to port on the host. also ensure that you map the www subfolder you created to the directory in the container that you are serving your static file from. IN firefox, navigate to localhost to show the directory listing on port which should contain your static file.
Make a screen capture showing the directory listing served on port
part : add the static service to the Docker Compose File.
Any static web services should be started as a part of the multicontainer application. Update the file dockercompose.yml of your company's Djangobased application to use the new webimage created in the previous part. This new service should be named weband should be exposed on port of the Docker host.
Once you have updated the dockercompose.yml file, use docker compost to start the multicontainer Django application. The output or your command should indicate all three containers dbweb and webwere created.
make a screen capture showing the creation of the web, weband db containers in the docker compose output.
IN firefox, navigate to your wbservice running on port to display a directory listing that contains the file you created in the previous part.
Make a screen capture showing the directory listing served on port
I need stepbystep instructions to do this in the Jones and Bartlett lab setting.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started