Sample Flask application using Flask-RESTPlus , Flask-Marshmallow and Flask-SQLAlchemy
Go inside the project folder and execute the below commands. We will use Pipenv to setup the VirtualEnv.
pipenv shell
pipenv install
Dependencies will be installed from the Pipfile. Python version 3.9 is used for this project.
python app.py
This will start the application on port 5000
Swagger-UI can be used to test the application.
The server will start at http://localhost:5000.
It also contain the DockerFile . In case we need to deploy it with Docker.
docker build -t docker_username/python-openfaas-demo .
docker tag docker_username/python-openfaas-demo rajhisaifeddine/python-openfaas-demo
docker push docker_username/python-openfaas-demo:latest
docker run -d -p 5000:5000 docker_username/python-openfaas-demo:latest
PS: do not forget to change docker_username with your own