Develop a Python Flask Application with Docker and Deploy to AWS – Part 1 Docker Beginnings

aws docker flask python Jan 11, 2019

Series  - Deploy a python flask app to AWS

I am currently taking the Udacity Machine Learning Engineer Nanodegree, and as a part of my project I wanted to deploy my dockerized machine learning model, along with a (very) simple front end interface, to AWS. I needed to review some materials, and realized I was having a lot of trouble finding a single resource that went from A-Z in all the various moving pieces. In this series I will go over:

  • Build a single docker container using Miniconda
  • Create a small python flask application
  • Serve our flask application with docker-compose
  • Deploy our application to AWS

The Sweet Promise of Victory

Have you ever had an idea completely crash and burn because you couldn't move it from your computer to the remote server, or the cloud, or because you updated your operating system and broke absolutely everything?

Me too! (I break operating systems frequently. It's a problem.) 

That is why I started developing, from start...

Continue Reading...

Develop a Python Flask Application with Docker and Deploy to AWS – Part 2 Serve a Flask App with Docker

aws flask python Jan 11, 2019

Overview

In this portion of the series we will be:

  • Creating a simple flask app with a few RESTful methods
  • Testing out our RESTful methods using curl.
  • Future proofing our development environment for easy and stress free deployment.

Get the Code

Clone the github repo to see the full code.

Create a flask app

Flask is a python framework for creating web applications. It has all kinds of functionality, but here we will be using just a small portion to create a few RESTful web routes.

A Note about Directory Structures

I tend to sit down with a paper and colored pens and figure out how I want my application organized. Generally, each service is in its own directory, which is then in its own docker container. A service is a single application, such as our flask app, a database, a job queue, etc. For this particular example we only have one service, the flask app, but hopefully you can see how important it is to organize your applications.

...
Continue Reading...
Close

50% Complete

Two Step

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.