DEV Community

Cover image for Deploy a Flask REST API - The Docker way and the Serverless way
amlan
amlan

Posted on

Deploy a Flask REST API - The Docker way and the Serverless way

Python has become a very famous programming language in recent times. Part of the reason for its popularity is that Python also has a Web framework which enables us to develop WEB API's and Web Apps. Flask is a very lightweight web framework and very easy to deploy via multiple ways.

One of the useful functionality which can be implemented using Flask is build and host a REST API. Using Flask and a backend database, an API interface can be easily materialized and the data from the database can be accessed over the API endpoints. The API endpoints can be invoked by a client web application to operate on the data from the database. It provides a secure interface for the client web app to access backend data. Using API endpoints for different services is also a very useful design pattern for applications which use microservice architecture.

In this post I will be going through process to deploy a simple REST API implemented in Flask. There are various ways by which we can deploy and make the API available over the web. Here I will be discussing two ways yo deploy a Flask API:

  • Deploy using Docker: Deploy the API as a Docker container.
  • Deploy using Lambda: Deploy in a Serverless way on AWS. Using Lambda and API Gateway.

Find the whole post here: https://amlanscloud.com/deployflask/

Top comments (2)

Collapse
 
realabbas profile image
Ali Abbas

Quite Insightful
Thanks for sharing

Collapse
 
amlana24 profile image
amlan

Thanks...sure just trying to share what I learn..