https://github.com/juggernaut/nginx-flask-postgres-docker-compose-example
A working example of nginx+flask+postgres multi-container setup using Docker Compose
https://github.com/juggernaut/nginx-flask-postgres-docker-compose-example
Last synced: 3 months ago
JSON representation
A working example of nginx+flask+postgres multi-container setup using Docker Compose
- Host: GitHub
- URL: https://github.com/juggernaut/nginx-flask-postgres-docker-compose-example
- Owner: juggernaut
- Created: 2017-09-20T16:36:08.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-28T04:54:25.000Z (over 8 years ago)
- Last Synced: 2024-11-25T16:39:06.731Z (over 1 year ago)
- Language: Python
- Size: 4.88 KB
- Stars: 130
- Watchers: 5
- Forks: 57
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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](http://www.ameyalokare.com/docker/2017/09/20/nginx-flask-postgres-docker-compose.html) for a detailed explanation.
## Usage
1. Bootstrap the DB
```bash
$ 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()'"
```
2. Bring up the cluster
```bash
$ docker-compose up -d
```
3. Browse to localhost:8080 to see the app in action.