This shows you the differences between two versions of the page.
ii:labs:s2:04:tasks:02 [2022/05/18 17:01] radu.ciobanu created |
ii:labs:s2:04:tasks:02 [2024/04/11 13:08] (current) radu.ciobanu [02. [20p] Building an image] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== 02. [00p] Testing a web application using Postman ==== | + | ==== 02. [20p] Building an image ==== |
== Subtasks == | == Subtasks == | ||
- | The application started earlier is a web application that does not have a graphical interface (i.e., a frontend). For this reason, it can only be tested by sending HTTP requests using a client such as [[https://www.postman.com|Postman]]. We will not show how to use Postman to connect to a web application backend. | + | - go to the //**flask_app**// folder from the {{:ii:labs:s2:04:lab4_docker.zip|lab archive}} |
+ | - modify the //**images**// array in the //**app.py**// file to make the application display other images of your choice | ||
+ | - modify the //**templates/index.html**// file to display a different title related to your chosen images (i.e., change line 22) | ||
+ | - build a Docker image entitled //**myflaskimage**// based on the provided //**Dockerfile**// | ||
+ | - run a container based on your image on port 8888 | ||
+ | - check [[http://localhost:8888]] to see if your container was started successfully | ||
- | In the Postman application, we can create the two types of applications we want to test: | + | <note important>If you are solving this lab on Play with Docker, you can access an exposed port by clicking on the port button as shown in red in the image below.</note> |
- | • GET shows us the list of books in the library | + | |
- | • POST adds a book to the library. | + | |
- | The steps to accomplish this are outlined below. First, once we have opened the Postman application, press the + button, as can be seen in the image below (the button is circled in red): | + | {{:ii:labs:s2:03:tasks:pwd_port.png?direct&800|}} |
- | + | ||
- | - | + | |
- | - | + | |
- | + | ||
- | + | ||
- | == What to upload == | + | |
- | + | ||
- | * a text file containing the executed commands | + |