-
Build a simple Flask application that accepts a JSON list of objects (developer's choice as to what the data would be), sorts it, and returns the results.
-
Put the Flask application into a Docker container and expose whatever port number to the host.
-
Provide the Dockerfile, source code, and a Makefile or other script that we could use to build the Docker container on our computers and try it out.
Disclaimer: The following has been tested on an Ubuntu 18.04 machine
To generate the flask-app container run:
docker build -t flask-app:latest .
To start the container in foreground mode run:
docker run -it -p 5000:5000 --rm flask-app
To start the container in background mode run:
docker run -d -p 5000:5000 --rm flask-app
To run the small test set included with this project:
python3 tests.py
I don't see why, but if you want to get into the container, run the following:
docker run -it -p 5000:5000 --entrypoint /bin/bash --rm flask-app
- Handle error when something other than numbers are provided
- Handle something other than json
- Improve sorting method
- ...
- Add NaN tests
- Add garbage tests
- Add bigger datasets and see the app crumble
- ...
- Add a UI for testing
- PyCharm
- VSCode
- GitHub
- Windows 10
- Ubuntu 18.04 (VM)