This repository contains a minimum RESTful API using Python and Flask. It exposes the endpoint http://HOST:5000/hello. This repository uses a Github Flow branching strategy and Github Actions to run pylint to lint the code and pytest to execute unit tests.
Upon successfull merge into main, a Docker container is built and pushed to Githubs container registry Github Packages.
Finally, the app is deployed to a Kubernetes cluster.
Running the API locally requires Python 3.9, install that first. Then:
python3 -m venv test-api # create virtual environment
source test-api/bin/activate # activate virtual environment
pip3 install -r requirements.txt # install python packages
python3 app/main.py # start API
Now, you can access http://127.0.0.1:5000/hello.
Building and running Docker containers requires Docker to be installed. Then:
docker build -t meine-api . # build Docker container
docker run -it -p 5000:5000 meine-api # run Docker container
Now, you can access http://127.0.0.1:5000/hello.