Develop a Python Flask Application with Docker and Deploy it to AWS – Part 3 Bring it together with docker compose

Uncategorized Jan 18, 2019

Recap

Up until this point we covered:

  •  Building a custom docker container using the official python miniconda container as our base.
  •  Interactively running commands in our custom image
  •  Giving docker build time instructions and run time instructions with RUN and CMD.
  • Spinning up a webserver that we can access on our own computers by exposing ports
  •  Mounting volumes and directories in our container for real time development.

Now we will use docker-compose to do all these things, but do them even better and with style.

Get the Code

Clone the github repo to see the full code.

Turbo Charge your Docker Dev with Docker-Compose

What is Docker Compose?

Now, I'm going to discuss an incredibly powerful method of connecting and building our docker containers using docker-compose. Docker compose is simply a layer on top of docker that allows us to compose our containers functionality into ...

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...

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

aws docker flask python Jan 11, 2019

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 to finish, in docker. I build, I copy, I deploy.

...
Continue Reading...
1 2 3 4 5
Close

50% Complete

Two Step

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