Skip to content

scottrogowski/docker_flask_nginx_minimal

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Flask, Nginx, & Docker minimal example

A minimal example of a docker container running both flask and nginx. Supervisord is required to manage them both since docker only allows for one entrypoint / cmd. The code is well commented.

Why?

For performance reasons, Python should not serve static files. The usual way to manage this is to run multiple containers or setup a good CDN. A good CDN is not always enough and I believe that running an entire application in a single container is simpler and more maintainable that trying to manage multiple containers of different types. I built this in the hope that others might find it useful.

To build:

docker build --tag minimal_server_image .

To run:

docker run --rm --publish 8888:80 --name minimal_server_container -t -i minimal_server_image

To view

Go to http://localhost:8888 in your browser

Globe gif is courtesy NASA

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published