Skip to content

websvcPT/flask-postgres-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask + ProstGreSQL Boilerplate

Docker contained project boilerplate

Installation

git clone git@github.com:theodo/flask-boilerplate.git && cd flask-boilerplate
docker-compose run --rm server pip install -r requirements.txt --user --upgrade
docker-compose up -d server

Accessing containers

Require Docker >= 1.3

# use 'docker ps' to see the list of your containers
docker exec -it flaskboilerplate_db_1 psql -Upostgres
docker exec -it flaskboilerplate_server_1 bash

Migration process

# Prior to the first migration
docker-compose run --rm server python src/manage.py db init

# Create a new version of the database
docker-compose run --rm server python src/manage.py db migrate
# check file + remove comment + improve file if needed
sudo vim migration/versions/<migration_id>.py

# Upgrade your database to the last version
docker-compose run --rm server python src/manage.py db upgrade

Run tests

docker-compose run --rm server python -m unittest

Commands

# Screenshot of python vendors
docker-compose run --rm server pip freeze > requirements.txt

# Run a command in the server container:
docker-compose run --rm server <command>

Releases

No releases published

Packages

No packages published

Languages