This Repository is a multi-container Docker application managed by Docker Compose.
- installed Docker
- installed Docker Compose
- Load the FastAPI Image from DockerHub
docker pull 108478/fastapi
- Load the Python Client Image from DockerHub
docker pull 108478/client
- Starting both COntainers as Services
docker-compose up
Web Framework providing one endpoint for returning a list of integeres in descending order.
Secret can be sent as API Key in the Header or Query Parameter.
Secret Key: "secret"
Secret Value: "1234567890123456789012345678901234567890"
For providing the Web Framework the official FastAPI Images are used. Image
The source code for the endpoint is located here:
fastAPI/app/main.py
Python Client which calls the endpoint. The Client is an CLI Python Application an takes the following Arguments
- Positional Arguments
values - List of Integer Values
secret - Provided API Key
- Optional parameters
--endpoint - Specify the endpoint to send the request to
docker exec -it clouddevtask_client_1 python app.py "[4,6,34,56,876,78,54,335]" "1234567890123456789012345678901234567890"
client/app/app.py
Just load the client:
docker pull 108478/client
Run container and start a session:
docker run -it --name test_client --rm 108478/client
After session is closed the container will be deleted (-rm Flag)