Fill out the provided Dockerfile Template to create a Docker Container
Hint: Create the Docker container with docker build -t <name:tag> .
Run the Container that you build in Step 1.
Hint: Remember to map the Exposed Port with the -p <localport>:<remoteport>
Test that you could access the following two endpoints of the Application.
- /greeting
- /greeting/<text>
For this you could use your Browser or run the following command:
curl localhost:<port>/greeting
curl localhost:<port>/greeting/<name>
Fill out the provided .gitlab-ci.yml
file to provide a CI/CD Testpipeline for the Application.
Test that the Container was successfully put to the Gitlab Docker Registry
Create an additional Endpoint /square/<number>
which returns the square of the given number by following these steps:
- Create a test
test_square_of_4_returns_16(self)
- Check that the test pass by running
python -m unittest -v
- Commit your changes
- Push the Changes to the repository
- Check the output of the CI/CD Pipeline
- Test the Endpoint with the Container created from the CI/CD Pipeline