Public Repository

Last pushed: 10 months ago
Short Description
Test Python flask app restful API application to build multi-container app
Full Description

This app uses MySQL as backend DB. So pls run below command first before starting up python_flask_container.

docker run --name db -e MYSQL_ROOT_PASSWORD=MyNewPass -d mysql

Then run below command to spin up the container of python flask app.

docker run --name lab1 -p 5000:5000 --link db:mysql -d mishraakshay91/python_flask_test

Now install an extension like Postman, etc on your favorite border and hit below POST request.

method - POST

URL http://127.0.0.1:5000/v1/expenses

body -
{ "name" : "Foo Bar", "email" : "foo@bar.com", "category" : "office supplies|travel|training", "description" : "iPad for office use", "link" : "http://www.apple.com/shop/buy-ipad/ipad-pro", "estimated_costs" : "700", "submit_date" : "09-08-2016" }
You should receive a valid response in JSON format with an integer value for the column id.
This means our python app container has established a successful connection with MySQL container, added data in MySQL and returned a valid response of creation of a record.

Docker Pull Command
Owner
mishraakshay91

Comments (0)