Skip to content

juggernaut/nginx-flask-postgres-docker-compose-example

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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

This is a working example of a multi-container flask application with Postgres as the database fronted by the nginx reverse proxy. See my blog post for a detailed explanation.

Usage

  1. Bootstrap the DB
$ docker-compose up -d db
$ docker-compose run --rm flaskapp /bin/bash -c "cd /opt/services/flaskapp/src && python -c  'import database; database.init_db()'"
  1. Bring up the cluster
$ docker-compose up -d
  1. Browse to localhost:8080 to see the app in action.

About

A working example of nginx+flask+postgres multi-container setup using Docker Compose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published